:root {
    --navy-950: #071426;
    --navy-900: #0b1f3a;
    --navy-800: #12345c;
    --blue-600: #147bd1;
    --blue-500: #1d91e8;
    --blue-100: #dceeff;
    --white: #ffffff;
    --gray-50: #f6f8fb;
    --gray-200: #dce2ea;
    --gray-500: #687386;
    --gray-800: #202938;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #067647;
    --success-bg: #ecfdf3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--gray-800);
    background: var(--navy-950);
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(420px, 0.85fr);
    min-height: 100vh;
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    padding: clamp(48px, 8vw, 120px);
    color: var(--white);
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 15%, rgba(29,145,232,.24), transparent 28%),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -160px;
    bottom: -180px;
    border: 1px solid rgba(255,255,255,.12);
    transform: rotate(30deg);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 3px solid var(--blue-500);
    border-radius: 22px;
    font-size: 42px;
    font-weight: 800;
    color: var(--white);
    transform: rotate(45deg);
}

.brand-mark::first-letter {
    transform: rotate(-45deg);
}

.brand-name {
    margin: 0 0 16px;
    color: var(--blue-500);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .18em;
}

.brand-panel h1 {
    max-width: 650px;
    margin: 0;
    font-size: clamp(38px, 5vw, 68px);
    line-height: 1.03;
}

.brand-description {
    max-width: 620px;
    margin: 24px 0 0;
    color: #c8d7e9;
    font-size: 18px;
    line-height: 1.7;
}

.security-label {
    width: fit-content;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    color: var(--blue-100);
    background: rgba(255,255,255,.06);
    font-size: 13px;
}

.form-panel {
    display: grid;
    place-items: center;
    padding: 42px;
    background: var(--gray-50);
}

.form-container {
    width: min(100%, 460px);
}

.form-heading {
    margin-bottom: 32px;
}

.eyebrow {
    color: var(--blue-600);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .14em;
}

.form-heading h2 {
    margin: 10px 0;
    color: var(--navy-900);
    font-size: 32px;
}

.form-heading p {
    margin: 0;
    color: var(--gray-500);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    color: var(--navy-900);
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 9px;
    outline: none;
    background: var(--white);
    font-size: 16px;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(29,145,232,.13);
}

.remember {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--gray-500);
    font-size: 14px;
}

.primary-button {
    min-height: 52px;
    border: 0;
    border-radius: 9px;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:hover {
    filter: brightness(1.05);
}

.alert {
    display: grid;
    gap: 4px;
    margin-bottom: 22px;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
}

.alert-success {
    color: var(--success);
    background: var(--success-bg);
}

.access-note {
    margin: 28px 0 0;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 850px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: 310px;
        padding: 42px 28px;
    }

    .brand-panel h1 {
        font-size: 38px;
    }

    .brand-description {
        font-size: 15px;
    }

    .form-panel {
        padding: 48px 24px;
    }
}

/* Identidad corporativa Geztion */
.geztion-logo {
    position: relative;
    z-index: 2;
    display: block;
    width: min(100%, 600px);
    height: auto;
    margin: 0 0 22px;
    object-fit: contain;
    object-position: left center;
}

.qr-container {
    display: grid;
    place-items: center;
    margin: 22px 0;
    padding: 20px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
}

.qr-container svg {
    display: block;
    width: min(100%, 240px);
    height: auto;
}

.mfa-instructions {
    margin: 20px 0;
    padding: 16px;
    border-left: 4px solid var(--blue-500);
    border-radius: 8px;
    background: var(--blue-100);
    color: var(--navy-900);
}

.mfa-instructions ol {
    margin: 10px 0 0;
    padding-left: 22px;
    line-height: 1.7;
}

.recovery-section {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 9px;
    background: var(--white);
}

.recovery-section summary {
    color: var(--navy-900);
    font-weight: 700;
    cursor: pointer;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.recovery-codes code {
    padding: 8px;
    border-radius: 6px;
    background: var(--gray-50);
    text-align: center;
}

.recovery-form {
    margin-top: 16px;
}

.secondary-button {
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--navy-900);
    background: var(--white);
    font-weight: 700;
    cursor: pointer;
}

.dashboard-body {
    min-height: 100vh;
    background: var(--gray-50);
}

.dashboard-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}

.dashboard-header h1 {
    margin: 8px 0 0;
    color: var(--navy-900);
}

.welcome-card {
    padding: 34px;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    background: var(--white);
}

.welcome-card h2 {
    color: var(--navy-900);
}

@media (max-width: 600px) {
    .recovery-codes {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.company-list {
    display: grid;
    gap: 14px;
}

.company-option {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
}

.company-option strong,
.company-option span {
    display: block;
}

.company-option strong {
    color: var(--navy-900);
    font-size: 17px;
}

.company-option span {
    margin-top: 5px;
    color: var(--gray-500);
    font-size: 13px;
}

.company-option .primary-button {
    min-height: 42px;
    padding: 8px 18px;
}

@media (max-width: 520px) {
    .company-option {
        grid-template-columns: 1fr;
    }
}

/* Recuperación segura de contraseña */
.login-options,
.auth-secondary-action {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.login-options a,
.auth-secondary-action a {
    color: #0875c1;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.login-options a:hover,
.auth-secondary-action a:hover {
    text-decoration: underline;
}

.auth-password-control {
    position: relative;
}

.auth-password-control input {
    padding-right: 88px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    padding: 6px 9px;
    border: 0;
    color: #0875c1;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transform: translateY(-50%);
}

.field small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

/* Corrección de navegación en recuperación */
.auth-secondary-action {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px 0 0;
}

.auth-secondary-action a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0875c1;
    background: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.auth-secondary-action a:hover {
    border-color: #1499e5;
    background: #f1f8fd;
    text-decoration: none;
}

/* Validador visual de contraseña */
.password-policy {
    padding: 16px;
    border: 1px solid #d7e2ec;
    border-radius: 10px;
    background: #f8fafc;
}

.password-policy-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #0f2742;
    font-size: 13px;
}

.password-strength-label {
    font-size: 12px;
    font-weight: 800;
}

.password-strength-label.empty {
    color: #64748b;
}

.password-strength-label.weak {
    color: #c62828;
}

.password-strength-label.medium {
    color: #b26a00;
}

.password-strength-label.good,
.password-strength-label.strong {
    color: #087a48;
}

.password-strength-track {
    width: 100%;
    height: 7px;
    margin: 12px 0 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.password-strength-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition:
        width 180ms ease,
        background-color 180ms ease;
}

.password-strength-bar.empty {
    background: #cbd5e1;
}

.password-strength-bar.weak {
    background: #dc3545;
}

.password-strength-bar.medium {
    background: #f5a623;
}

.password-strength-bar.good {
    background: #16a36a;
}

.password-strength-bar.strong {
    background: #087a48;
}

.password-requirements-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.password-requirements-list li {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.password-requirements-list li.completed {
    color: #087a48;
    font-weight: 700;
}

.requirement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    border-radius: 50%;
    font-weight: 900;
}

.password-requirements-list li.completed
.requirement-icon {
    color: #ffffff;
    background: #16a36a;
}

.password-match-status {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
}

.password-match-status.pending {
    color: #64748b;
}

.password-match-status.completed {
    color: #087a48;
}

.password-match-status.invalid {
    color: #c62828;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

@media (max-width: 560px) {
    .password-requirements-list {
        grid-template-columns: 1fr;
    }
}
