/* TuAgendaMédica — private access screens. Kept separate from the public site. */
:root {
    color-scheme: light;
    --auth-navy: #10243c;
    --auth-ink: #142842;
    --auth-muted: #687990;
    --auth-blue: #315de6;
    --auth-border: #dde4ed;
    --auth-ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #fff; }
body.auth-page {
    min-width: 320px;
    margin: 0;
    color: var(--auth-ink);
    background: #fff;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--auth-blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
svg { display: block; width: 20px; height: 20px; flex: none; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid #96b2ff; outline-offset: 4px; }

.auth-scene { display: grid; grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr); min-height: 100vh; min-height: 100svh; }
.auth-story {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    padding: clamp(36px, 4.5vw, 72px);
    color: #fff;
    background: var(--auth-navy);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.auth-story::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto -180px -360px auto;
    width: 640px;
    height: 640px;
    border: 1px solid rgb(255 255 255 / 5%);
    border-radius: 50%;
    box-shadow: 0 0 0 90px rgb(255 255 255 / 1.5%), 0 0 0 180px rgb(255 255 255 / 1%);
    pointer-events: none;
}
.auth-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: #fff; font-size: 21px; letter-spacing: -.7px; line-height: 1.2; font-weight: 450; }
.auth-brand:hover { text-decoration: none; }
.auth-brand strong { font-weight: 700; }
.auth-brand-icon { display: grid; place-items: center; width: 34px; height: 38px; color: #67afff; }
.auth-brand-icon svg { width: 33px; height: 33px; }
.auth-story-content { width: 100%; max-width: 510px; margin: auto 0; padding: 16px 0; animation: auth-enter 240ms var(--auth-ease) both; }
.auth-story h2 { margin: 0; font-size: clamp(36px, 4vw, 62px); line-height: 1.13; letter-spacing: -.055em; font-weight: 650; }
.auth-story h2 span { color: #a4c5fa; }
.auth-story-content > p { max-width: 340px; margin: 24px 0 34px; color: #b8c7d9; font-size: 16px; line-height: 1.8; }
.auth-preview { width: 100%; max-width: 426px; border: 1px solid #3c5068; border-radius: 15px; background: #1b3048; box-shadow: 0 20px 52px rgb(0 8 20 / 12%); overflow: hidden; }
.auth-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 21px 24px 17px; font-size: 14px; font-weight: 550; }
.auth-preview-head small { color: #a9bbcf; font-size: 11px; font-weight: 400; }
.auth-preview-appointment { display: flex; align-items: flex-start; padding: 12px 24px 25px; gap: 22px; }
.auth-preview-time { font-size: 36px; font-weight: 600; letter-spacing: -.055em; line-height: 1.1; min-width: 96px; padding: 4px 22px 4px 0; border-right: 1px solid #3b4e65; }
.auth-preview-time small { display: block; margin-top: 9px; color: #a9bbcf; font-size: 12px; font-weight: 400; letter-spacing: 0; }
.auth-preview-person { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.auth-preview-person strong { font-size: 17px; font-weight: 600; letter-spacing: -.25px; }
.auth-preview-person > span { color: #b8c7d9; font-size: 12px; }
.auth-preview-person .auth-preview-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; color: #afe6cf; font-size: 11px; }
.auth-preview-status i { width: 6px; height: 6px; border-radius: 50%; background: #78d7b2; }
.auth-preview-foot { display: flex; align-items: center; gap: 9px; padding: 14px 24px; border-top: 1px solid #3b4e65; color: #b8c7d9; font-size: 11px; line-height: 1.6; }
.auth-preview-foot svg { width: 15px; height: 15px; color: #92b8ed; }
.auth-story-footer { display: flex; align-items: center; gap: 24px; color: #a9bbcf; font-size: 12px; letter-spacing: .1px; }
.auth-story-line { height: 1px; max-width: 86px; flex: 1; background: #43566c; }

.auth-workspace { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; position: relative; padding: 78px clamp(28px, 5.8vw, 96px) 88px; }
.auth-card { width: 100%; max-width: 410px; margin: auto 0; padding: 30px 0; animation: auth-enter 220ms var(--auth-ease) both; }
.auth-card h1 { margin: 0; color: var(--auth-ink); font-size: clamp(28px, 2.4vw, 35px); line-height: 1.2; letter-spacing: -1.2px; font-weight: 650; }
.auth-intro { margin: 15px 0 32px; color: var(--auth-muted); font-size: 14px; line-height: 1.8; max-width: 375px; }
.auth-form { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.auth-form .field { display: flex; flex-direction: column; min-width: 0; gap: 9px; }
.auth-form .field > label, .auth-label-row label { color: #263b54; font-size: 13px; line-height: 1.4; font-weight: 550; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; }
.auth-label-row a { font-size: 12px; font-weight: 500; line-height: 1.4; }
.auth-input-shell { display: flex; align-items: center; position: relative; background: #fff; border: 1px solid var(--auth-border); border-radius: 9px; min-width: 0; transition: border-color 180ms var(--auth-ease), box-shadow 180ms var(--auth-ease), background 180ms var(--auth-ease); }
.auth-input-shell:hover { border-color: #b8c5d5; }
.auth-input-shell:focus-within { background: #fff; border-color: var(--auth-blue); box-shadow: 0 0 0 3px rgb(49 93 230 / 10%); }
.auth-input-shell > svg { position: absolute; left: 15px; color: #8391a4; width: 18px; height: 18px; pointer-events: none; }
.auth-input-shell:focus-within > svg { color: var(--auth-blue); }
.auth-input-shell input { width: 100%; min-width: 0; height: 50px; margin: 0; padding: 0 14px 0 44px; border: 0; border-radius: inherit; outline: none; background: transparent; color: var(--auth-ink); font-size: 14px; line-height: normal; box-shadow: none; }
.auth-input-shell input::placeholder { color: #8a97a8; opacity: 1; }
.auth-input-shell:has(.auth-password-toggle) input { padding-right: 49px; }
.auth-input-shell input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #f8faff inset; -webkit-text-fill-color: var(--auth-ink); }
.auth-password-toggle { display: grid; place-items: center; position: absolute; right: 4px; width: 42px; height: 42px; padding: 0; color: #79899f; background: transparent; border: 0; border-radius: 7px; transition: background 180ms var(--auth-ease), color 180ms var(--auth-ease); }
.auth-password-toggle svg { width: 18px; height: 18px; stroke-width: 1.6; }
.auth-password-toggle:hover { color: var(--auth-blue); background: #edf2ff; }
.auth-password-toggle.is-visible { color: var(--auth-blue); background: #eef3ff; }
.auth-remember { display: flex; align-items: flex-start; gap: 9px; color: #60728a; font-size: 12px; line-height: 1.6; cursor: pointer; margin-top: -2px; }
.auth-remember input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; border-radius: 4px; accent-color: var(--auth-blue); }
.auth-submit { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 51px; margin-top: 2px; padding: 14px 20px; background: var(--auth-blue); border: 1px solid var(--auth-blue); border-radius: 9px; color: #fff; font-size: 14px; font-weight: 550; line-height: 1.4; box-shadow: 0 4px 12px rgb(49 93 230 / 13%); transition: background 180ms var(--auth-ease), border-color 180ms var(--auth-ease), box-shadow 180ms var(--auth-ease), transform 180ms var(--auth-ease); }
.auth-submit svg { width: 18px; height: 18px; transition: transform 180ms var(--auth-ease); }
.auth-submit:hover:not(:disabled) { background: #244dcc; border-color: #244dcc; box-shadow: 0 6px 18px rgb(49 93 230 / 23%); transform: translateY(-1px); }
.auth-submit:hover:not(:disabled) svg { transform: translateX(3px); }
.auth-submit:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 7px rgb(49 93 230 / 15%); }
.auth-submit.is-busy { background: #244dcc; border-color: #244dcc; box-shadow: none; }
.auth-submit.is-busy svg { display: none; }
.auth-submit.is-busy::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 35%); border-top-color: #fff; animation: auth-spin 800ms linear infinite; }
.auth-card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; padding-top: 27px; margin-top: 29px; border-top: 1px solid #edf0f5; font-size: 12px; color: var(--auth-muted); }
.auth-card-footer a { font-weight: 550; }
.auth-workspace-footer { position: absolute; bottom: 30px; left: 24px; right: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: #7b899a; font-size: 11px; text-align: center; }
.auth-back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 35px; color: #61738b; font-size: 12px; }
.auth-back-link svg { width: 16px; height: 16px; }
.auth-back-link:hover { color: var(--auth-blue); }
.auth-help { color: var(--auth-muted); padding-top: 21px; margin: 26px 0 0; border-top: 1px solid #edf0f5; font-size: 12px; line-height: 1.8; }
.auth-field-help { font-size: 11px; color: #748298; line-height: 1.6; }
.flash { padding: 13px 15px; margin: 0 0 24px; border: 1px solid; border-radius: 9px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.flash-error { background: #fff5f5; border-color: #f2d5d5; color: #9d3030; }
.flash-ok { background: #f0faf5; border-color: #cceadb; color: #246a4a; }

@keyframes auth-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (min-width: 1600px) {
    .auth-story { padding-left: max(72px, calc((100vw - 1440px) / 2)); }
    .auth-workspace { padding-right: max(96px, calc((100vw - 1440px) / 2)); }
}
@media (max-width: 1100px) and (min-width: 761px) {
    .auth-story { padding: 38px 32px; }
    .auth-brand { font-size: 18px; gap: 8px; }
    .auth-story h2 { font-size: 43px; }
    .auth-story-content > p { font-size: 14px; }
    .auth-preview-head, .auth-preview-foot { padding-left: 18px; padding-right: 18px; }
    .auth-preview-appointment { padding-left: 18px; padding-right: 18px; gap: 15px; }
    .auth-preview-time { font-size: 30px; min-width: 80px; padding-right: 15px; }
    .auth-preview-person strong { font-size: 15px; }
    .auth-preview-foot { font-size: 10px; }
    .auth-workspace { padding-left: 36px; padding-right: 36px; }
    .auth-card h1 { font-size: 29px; }
}
@media (max-width: 760px) {
    .auth-scene { display: flex; flex-direction: column; }
    .auth-story { flex: none; gap: 26px; padding: 26px 28px 29px; }
    .auth-brand { font-size: 19px; gap: 9px; }
    .auth-brand-icon, .auth-brand-icon svg { width: 29px; height: 29px; }
    .auth-story-content { max-width: none; margin: 0; padding: 0; }
    .auth-story h2 { font-size: 25px; line-height: 1.28; letter-spacing: -.75px; }
    .auth-story h2 br { display: none; }
    .auth-story h2 span::before { content: " "; }
    .auth-story-content > p, .auth-preview, .auth-story-footer { display: none; }
    .auth-story::after { width: 400px; height: 400px; inset: -200px -220px auto auto; }
    .auth-workspace { flex: 1; padding: 35px 28px 24px; justify-content: flex-start; }
    .auth-card { margin: 0; padding: 0; max-width: 440px; }
    .auth-card h1 { font-size: 28px; line-height: 1.25; letter-spacing: -1px; }
    .auth-intro { margin-top: 11px; margin-bottom: 27px; font-size: 14px; }
    .auth-form { gap: 20px; }
    .auth-input-shell input { font-size: 16px; }
    .auth-card-footer { margin-top: 27px; padding-top: 23px; }
    .auth-workspace-footer { position: static; margin-top: 42px; }
    .auth-back-link { margin-bottom: 23px; }
}
@media (max-width: 380px) {
    .auth-story { padding: 23px 22px 26px; gap: 24px; }
    .auth-story h2 { font-size: 22px; }
    .auth-workspace { padding: 29px 22px 22px; }
    .auth-card h1 { font-size: 25px; }
    .auth-card-footer { font-size: 11px; }
}
@media (max-height: 760px) and (min-width: 761px) {
    .auth-story { padding-top: 32px; padding-bottom: 32px; gap: 24px; }
    .auth-story h2 { font-size: clamp(36px, 3.7vw, 53px); }
    .auth-story-content > p { margin-top: 19px; margin-bottom: 25px; }
    .auth-workspace { padding-top: 36px; padding-bottom: 68px; }
    .auth-card { padding: 14px 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .auth-submit:hover:not(:disabled), .auth-submit:hover:not(:disabled) svg { transform: none; }
}
