@font-face {
    font-family: "Segoe UI VZLA";
    src: url("../../admin/fonts/Segoe-ui.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Segoe UI VZLA";
    src: url("../../admin/fonts/Segoe-ui-bold.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 700;
}

:root {
    color-scheme: light;
    --login-blue: #0f42aa;
    --login-blue-dark: #0b3285;
    --login-ink: #182b4b;
    --login-text: #445269;
    --login-muted: #627089;
    --login-border: #c9d3e2;
    --login-bg: #f5f8fc;
    --login-error: #a82121;
    --login-error-bg: #fff4f4;
    --login-focus: #ffcf21;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--login-bg);
    font-size: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--login-text);
    background: var(--login-bg);
    font-family: "Segoe UI VZLA", "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

a {
    color: var(--login-blue);
    font-weight: 700;
    text-underline-offset: .18em;
}

a:hover {
    color: var(--login-blue-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--login-focus);
    outline-offset: 3px;
}

.login-page {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 5vh, 56px) 20px;
}

.login-card {
    width: min(100%, 510px);
    margin: 0 auto;
    padding: 38px 40px 34px;
    background: #fff;
    border: 1px solid #dfe6f0;
    border-radius: 16px;
    box-shadow: 0 16px 42px rgba(24, 55, 101, .10);
}

.login-header {
    margin-bottom: 26px;
    text-align: center;
}

.login-logo {
    display: block;
    width: 118px;
    height: auto;
    margin: 0 auto 18px;
}

.login-header h1 {
    margin: 0;
    color: var(--login-ink);
    font-size: clamp(1.875rem, 5vw, 2.125rem);
    line-height: 1.2;
    font-weight: 700;
}

.login-header p {
    margin: 8px 0 0;
    color: var(--login-text);
    font-size: 1.0625rem;
}

.login-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    color: #761919;
    background: var(--login-error-bg);
    border: 1px solid #e8bcbc;
    border-left: 4px solid var(--login-error);
    border-radius: 9px;
    font-size: .9375rem;
}

.login-alert--hidden {
    display: none;
}

.login-alert__support {
    display: none;
    margin-top: 5px;
}

.login-alert[data-error-kind="technical"] .login-alert__support {
    display: block;
}

.login-field {
    margin-bottom: 12px;
}

.login-field label {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--login-ink);
    font-size: .9375rem;
    font-weight: 700;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap input {
    width: 100%;
    min-height: 54px;
    padding: 12px 50px 12px 45px;
    color: #17243a;
    background: #fff;
    border: 1px solid var(--login-border);
    border-radius: 9px;
    font-size: 1rem;
    line-height: 1.35;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-input-wrap input::placeholder {
    color: #7a879c;
    opacity: 1;
}

.login-input-wrap input:hover {
    border-color: #9caac0;
}

.login-input-wrap input:focus {
    border-color: var(--login-blue);
    box-shadow: 0 0 0 3px rgba(15, 66, 170, .15);
}

.login-input-wrap input[aria-invalid="true"] {
    border-color: var(--login-error);
}

.login-input-icon,
.password-toggle svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.login-input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    width: 20px;
    height: 20px;
    color: #65758d;
    pointer-events: none;
    transform: translateY(-50%);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #53657e;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--login-blue);
    background: #eef3fb;
}

.password-toggle svg {
    width: 22px;
    height: 22px;
}

.password-toggle__hide,
.password-toggle[aria-pressed="true"] .password-toggle__show {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle__hide {
    display: block;
}

.login-field-error {
    margin: 5px 0 0;
    color: var(--login-error);
    font-size: .875rem;
    line-height: 1.35;
}

.login-field-error:empty {
    display: none;
}

.login-options {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px 20px;
    margin: 2px 0 16px;
    font-size: .875rem;
}

.login-checkbox {
    display: flex;
    flex: 1 1 250px;
    min-height: 44px;
    align-items: flex-start;
    gap: 9px;
    color: var(--login-text);
    cursor: pointer;
}

.login-checkbox input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    accent-color: var(--login-blue);
}

.login-options > a {
    display: inline-flex;
    min-height: 44px;
    align-items: flex-start;
    flex: 0 0 auto;
}

.login-submit {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    color: #fff;
    background: var(--login-blue);
    border: 1px solid var(--login-blue);
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.login-submit--passkey {
    margin-top: 0.75rem;
    background: #fff;
    color: #0f42aa;
    border: 1px solid #0f42aa;
}

.login-submit--passkey:hover,
.login-submit--passkey:focus-visible {
    background: #f3f7ff;
}

.login-submit:disabled {
    color: #fff;
    background: #6079ad;
    border-color: #6079ad;
    cursor: wait;
}

.login-submit__spinner {
    display: none;
    width: 19px;
    height: 19px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .8s linear infinite;
}

.login-submit[data-submitting="true"] .login-submit__spinner {
    display: inline-block;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

.login-signup {
    margin: 20px 0 0;
    text-align: center;
}

.login-signup a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.login-footer {
    width: min(100%, 560px);
    margin: 20px auto 0;
    color: var(--login-muted);
    text-align: center;
    font-size: .875rem;
}

.login-support {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
}

.login-support a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.login-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 20px;
    margin-top: 12px;
}

.login-legal a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.login-footer .recaptcha-disclosure {
    max-width: 510px;
    margin-top: 16px;
    color: #66748a;
    font-size: .75rem;
}

@media (hover: hover) and (pointer: fine) {
    .login-submit:not(:disabled):hover {
        background: var(--login-blue-dark);
        border-color: var(--login-blue-dark);
    }
}

@media (max-width: 560px) {
    .login-page {
        justify-content: flex-start;
        padding: 20px 16px 28px;
    }

    .login-card {
        padding: 25px 23px 24px;
        border-radius: 13px;
        box-shadow: 0 6px 18px rgba(24, 55, 101, .07);
    }

    .login-header {
        margin-bottom: 22px;
    }

    .login-logo {
        width: 104px;
        margin-bottom: 14px;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .login-header p {
        font-size: 1rem;
    }

    .login-options {
        flex-direction: column;
    }

    .login-checkbox {
        flex-basis: auto;
    }
}

@media (max-width: 350px) {
    .login-page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .login-card {
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    .login-submit__spinner {
        animation-duration: 1.5s;
    }
}

/* UX authentication refinements — phone recovery, passkey clarity and alerts */
.login-page {
    align-items: center;
}

.login-card,
.login-footer,
.login-recaptcha-disclosure {
    margin-inline: auto;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--login-muted);
    font-size: .8125rem;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1 1 auto;
    background: #dfe6f0;
}

.login-passkey-block {
    text-align: center;
}

.login-passkey-title {
    margin: 0;
    color: var(--login-ink);
    font-weight: 700;
}

.login-passkey-help {
    margin: 5px 0 10px;
    color: var(--login-muted);
    font-size: .875rem;
    line-height: 1.4;
}

.login-submit--passkey {
    margin-top: 0;
}

.login-passkey-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-submit--passkey:disabled {
    color: #4b608a;
    background: #f2f5fa;
    border-color: #b9c6da;
}

.login-phone-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 13px 14px;
    background: #f6f8fc;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
}

.login-phone-help__content {
    min-width: 0;
}

.login-phone-help strong {
    display: block;
    color: var(--login-ink);
    font-size: .9rem;
}

.login-phone-help p {
    margin: 3px 0 0;
    color: var(--login-muted);
    font-size: .8125rem;
    line-height: 1.35;
}

.login-phone-help > a {
    flex: 0 0 auto;
    text-align: right;
    font-size: .875rem;
}

.login-signup--account {
    margin-top: 18px;
}

.login-recaptcha-disclosure {
    width: min(100%, 510px);
    padding: 0 12px;
}

.login-recaptcha-disclosure .recaptcha-disclosure {
    max-width: 100%;
    margin: 12px auto 0;
    overflow-wrap: anywhere;
}

.login-alert[data-error-kind="rate_limited"] {
    color: #6a4500;
    background: #fff8e6;
    border-color: #efd28a;
    border-left-color: #b77900;
    box-shadow: 0 6px 18px rgba(106, 69, 0, .08);
}

.login-alert[data-error-kind="rate_limited"]::before {
    content: "Límite de intentos · ";
    font-weight: 700;
}

@media (max-width: 560px) {
    .login-phone-help {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-phone-help > a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        text-align: left;
    }
}
