/* Estilos exclusivos de la pantalla de acceso de SAGE. */
.sage-login {
    --sage-primary: #174c43;
    --sage-secondary: #347c68;
    --sage-sage: #a8cdb8;
    --sage-background: #f0f5f1;
    --sage-surface: #ffffff;
    --sage-text: #18312c;
    --sage-muted: #5d6f69;
    --sage-border: #cedbd5;
    --sage-danger: #a23434;
    --sage-danger-bg: #fff3f2;
    --sage-info: #315f53;
    --sage-info-bg: #edf7f2;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--sage-background);
    color: var(--sage-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

.sage-login__main {
    min-height: calc(100vh - 72px);
    min-height: calc(100dvh - 72px);
    display: grid;
    place-items: center;
    padding: clamp(24px, 5vw, 64px);
}

.sage-login__shell {
    width: min(1120px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
    overflow: hidden;
    background: var(--sage-surface);
    border: 1px solid rgba(23, 76, 67, 0.12);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(23, 76, 67, 0.14);
}

.sage-login__identity {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: clamp(40px, 5vw, 68px);
    overflow: hidden;
    background: var(--sage-primary);
    color: #ffffff;
}

.sage-login__identity::before,
.sage-login__identity::after {
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    content: "";
}

.sage-login__identity::before {
    top: -120px;
    right: -150px;
    width: 360px;
    height: 360px;
    border: 64px solid rgba(168, 205, 184, 0.12);
}

.sage-login__identity::after {
    right: -70px;
    bottom: -100px;
    width: 280px;
    height: 280px;
    background: rgba(52, 124, 104, 0.38);
}

.sage-login__brand {
    display: flex;
    align-items: center;
    min-height: 56px;
}

.sage-login__brand-mark {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding-left: 18px;
    border-left: 4px solid var(--sage-sage);
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 750;
    letter-spacing: 0.14em;
    line-height: 1;
}

.sage-login__identity-content {
    max-width: 440px;
    margin: clamp(64px, 12vh, 128px) 0 auto;
}

.sage-login__eyebrow {
    margin: 0 0 18px;
    color: var(--sage-sage);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sage-login__identity h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.625rem, 1.9vw, 1.6875rem);
    font-weight: 650;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.sage-login__tagline {
    margin: 28px 0 0;
    color: #dcece4;
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    line-height: 1.55;
}

.sage-login__identity-note {
    position: relative;
    z-index: 1;
    max-width: 390px;
    margin: 52px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    line-height: 1.65;
}

.sage-login__access {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: clamp(40px, 6vw, 76px);
}

.sage-login__access-inner {
    width: min(100%, 440px);
}

.sage-login__access-header {
    margin-bottom: 34px;
}

.sage-login__access-kicker {
    margin: 0 0 8px;
    color: var(--sage-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sage-login__access-header h2 {
    margin: 0;
    color: var(--sage-primary);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.sage-login__access-header > p:last-child {
    margin: 12px 0 0;
    color: var(--sage-muted);
    font-size: 0.96rem;
    line-height: 1.6;
}

.sage-login__message {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 22px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sage-login__message svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sage-login__message--error {
    border-color: #e9b9b5;
    background: var(--sage-danger-bg);
    color: var(--sage-danger);
}

.sage-login__message--info {
    border-color: #b8d8ca;
    background: var(--sage-info-bg);
    color: var(--sage-info);
}

.sage-login__form {
    display: grid;
    gap: 22px;
}

.sage-login__field {
    display: grid;
    gap: 8px;
}

.sage-login__field label {
    color: var(--sage-text);
    font-size: 0.9rem;
    font-weight: 650;
}

.sage-login__control {
    position: relative;
}

.sage-login__control svg {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: var(--sage-secondary);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    transform: translateY(-50%);
    pointer-events: none;
}

.sage-login__control input {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px 13px 49px;
    border: 1px solid var(--sage-border);
    border-radius: 12px;
    outline: none;
    background: #ffffff;
    color: var(--sage-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.sage-login__control input::placeholder {
    color: #81908b;
    opacity: 1;
}

.sage-login__control input:hover {
    border-color: #91ada3;
}

.sage-login__control input:focus,
.sage-login__control input:focus-visible {
    border-color: var(--sage-secondary);
    box-shadow: 0 0 0 4px rgba(52, 124, 104, 0.16);
}

.sage-login__control:focus-within svg {
    stroke: var(--sage-primary);
}

.sage-login__control input:-webkit-autofill,
.sage-login__control input:-webkit-autofill:hover,
.sage-login__control input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--sage-text);
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
}

.sage-login__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    padding: 13px 20px;
    border: 1px solid var(--sage-primary);
    border-radius: 12px;
    background: var(--sage-primary);
    color: #ffffff;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.sage-login__submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.sage-login__submit:hover {
    border-color: #103b34;
    background: #103b34;
}

.sage-login__submit:focus-visible {
    outline: 3px solid var(--sage-sage);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(168, 205, 184, 0.22);
}

.sage-login__support {
    margin: 26px 0 0;
    color: var(--sage-muted);
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: center;
}

.sage-login__footer {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px 20px;
    padding: 18px 24px;
    color: #60716b;
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: center;
}

.sage-login__footer span + span::before {
    margin-right: 20px;
    color: var(--sage-sage);
    content: "\2022";
}

@media (max-width: 860px) {
    .sage-login__main {
        min-height: auto;
        padding: 24px;
    }

    .sage-login__shell {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .sage-login__identity {
        min-height: 300px;
        padding: 38px;
    }

    .sage-login__identity-content {
        margin: 54px 0 0;
    }

    .sage-login__identity h1 {
        max-width: 620px;
        font-size: clamp(1.7rem, 4.2vw, 2rem);
    }

    .sage-login__identity-note {
        display: none;
    }

    .sage-login__access {
        padding: 48px 38px;
    }
}

@media (max-width: 520px) {
    .sage-login__main {
        padding: 0;
    }

    .sage-login__shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .sage-login__identity {
        min-height: 260px;
        padding: 30px 24px;
    }

    .sage-login__brand-mark {
        min-height: 42px;
        font-size: 1.8rem;
    }

    .sage-login__identity-content {
        margin-top: 38px;
    }

    .sage-login__identity h1 {
        font-size: clamp(1.65rem, 7.5vw, 2rem);
    }

    .sage-login__tagline {
        margin-top: 18px;
        font-size: 0.96rem;
    }

    .sage-login__access {
        padding: 42px 24px 48px;
    }

    .sage-login__access-header {
        margin-bottom: 30px;
    }

    .sage-login__footer {
        flex-direction: column;
        gap: 4px;
        min-height: 86px;
    }

    .sage-login__footer span + span::before {
        content: none;
    }
}

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