/*
 * PsicoVita — Telas de acesso v2 (login, cadastro, recuperar/redefinir senha, verificação, 2FA…)
 * Mesmo padrão visual da landing v2 (public/css/landing-v2.css): azul #0369a1, teal #0f766e, navy #0a1f35,
 * fotos reais, logo original. CSS sem build, carregado em components/auth-split-layout.blade.php.
 * Prefixo .av- para não colidir com Tailwind. Campos e botões existentes são ajustados por seletor,
 * sem mudar nomes, rotas, CSRF ou validações.
 */

:root {
    --av-blue: #0369a1;
    --av-blue-deep: #075985;
    --av-sky: #38bdf8;
    --av-sky-soft: #7dd3fc;
    --av-sky-mist: #e0f2fe;
    --av-teal: #0f766e;
    --av-teal-mist: #ccfbf1;
    --av-navy: #0f2b48;
    --av-navy-deep: #0a1f35;
    --av-paper: #f5fbff;
    --av-text: #475569;
    --av-line: #dbe4ee;
    --av-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.av { margin: 0; background: var(--av-paper); color: var(--av-navy); font-family: Inter, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.dark .av { background: #020617; color: #e2e8f0; }

/* ---------- Estrutura ---------- */
.av-shell { display: flex; min-height: 100%; }
@media (min-width: 1024px) {
    .av-shell { height: 100vh; overflow: hidden; padding: 12px; gap: 0; }
}

/* ---------- Painel da marca (foto) ---------- */
.av-panel { display: none; }
@media (min-width: 1024px) {
    .av-panel { position: relative; display: flex; flex-direction: column; width: 46%; max-width: 62rem; flex-shrink: 0; overflow: hidden; border-radius: 28px; background: var(--av-navy-deep); color: #fff; isolation: isolate; }
}
.av-panel__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.av-panel__shade {
    position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(180deg, rgb(10 31 53 / .72) 0%, rgb(10 31 53 / .18) 26%, rgb(10 31 53 / .30) 48%, rgb(10 31 53 / .92) 78%, rgb(7 24 42 / .97) 100%);
}
.av-panel__body { display: flex; flex-direction: column; height: 100%; padding: clamp(1.5rem, 4vh, 2.75rem) clamp(1.5rem, 3vw, 2.75rem); }
.av-panel__logo { display: inline-flex; width: fit-content; border-radius: 10px; transition: opacity .2s ease; }
.av-panel__logo:hover { opacity: .9; }
.av-panel__logo:focus-visible { outline: 2px solid var(--av-sky-soft); outline-offset: 4px; }
.av-panel__logo img { display: block; height: clamp(44px, 6vh, 58px); width: auto; object-fit: contain; }

.av-panel__card-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: flex-start; padding-block: clamp(1rem, 3vh, 2rem); }
.av-panel__card {
    width: min(20rem, 100%); padding: 20px; border-radius: 22px; background: rgb(255 255 255 / .97);
    box-shadow: 0 30px 70px -24px rgb(2 12 27 / .65), 0 0 0 1px rgb(255 255 255 / .6) inset;
}
@media (max-height: 760px) { .av-panel__card-wrap { visibility: hidden; } }

.av-panel__title { margin: 0; font-size: clamp(2.1rem, 0.6rem + 1.4vw + 2.4vh, 3.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; text-wrap: balance; }
.av-panel__accent { color: var(--av-sky-soft); }
.av-panel__sub { margin: 14px 0 0; max-width: 30rem; font-size: clamp(.98rem, .6rem + .9vh, 1.12rem); line-height: 1.55; color: #e0f2fe; }

.av-panel__trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: clamp(1.1rem, 3vh, 1.75rem) 0 0; padding: clamp(.9rem, 2vh, 1.15rem) 0 0; list-style: none; border-top: 1px solid rgb(255 255 255 / .16); }
.av-panel__trust li { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: rgb(255 255 255 / .86); }
.av-panel__trust svg { color: #5eead4; flex-shrink: 0; }

/* ---------- Área do formulário ---------- */
.av-main {
    position: relative; display: flex; flex: 1; flex-direction: column; min-height: 100%;
    padding: clamp(1rem, 2.4vh, 1.5rem) clamp(1.25rem, 4vw, 4.5rem);
    background: radial-gradient(60rem 30rem at 100% 0%, rgb(224 242 254 / .9), transparent 60%), radial-gradient(40rem 26rem at 0% 100%, rgb(204 251 241 / .45), transparent 60%);
}
.av-main:focus { outline: none; }
.dark .av-main { background: radial-gradient(60rem 30rem at 100% 0%, rgb(3 105 161 / .16), transparent 60%); }
@media (min-width: 1024px) { .av-main { overflow-y: auto; } }

.av-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.av-topbar__logo { display: inline-flex; border-radius: 10px; }
.av-topbar__logo img { display: block; height: 42px; width: auto; object-fit: contain; }
.dark .av-topbar__logo img { background: rgb(255 255 255 / .95); border-radius: 10px; padding: 4px 8px; }
@media (min-width: 1024px) { .av-topbar__logo { visibility: hidden; } }
.av-topbar__actions { display: flex; align-items: center; gap: 8px; }
.av-back {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px;
    border: 1px solid #cbd5e1; background: rgb(255 255 255 / .8); color: var(--av-navy); font-size: 14px; font-weight: 600;
    text-decoration: none; transition: border-color .2s ease, background-color .2s ease, transform .2s var(--av-ease);
}
.av-back:hover { border-color: var(--av-sky-soft); background: #f0f9ff; }
.av-back:hover svg { transform: translateX(-2px); }
.av-back svg { transition: transform .2s var(--av-ease); }
.dark .av-back { border-color: #334155; background: rgb(15 23 42 / .7); color: #e2e8f0; }
.dark .av-back:hover { background: #0f172a; border-color: #475569; }
@media (max-width: 420px) { .av-back { padding: 0 12px; } }
@media (max-width: 639px) { .av-legal > svg, .av-legal > span[aria-hidden] { display: none; } .av-legal { flex-direction: column; } }

.av-form { position: relative; width: 100%; max-width: 31rem; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: clamp(1.25rem, 4vh, 2.5rem); }

.av-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--av-teal-mist); color: #115e59; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.av-eyebrow span { width: 7px; height: 7px; border-radius: 999px; background: var(--av-teal); box-shadow: 0 0 0 3px rgb(15 118 110 / .18); }
.dark .av-eyebrow { background: rgb(19 78 74 / .55); color: #99f6e4; }
.av-h1 { margin: 14px 0 0; font-size: clamp(1.85rem, 0.9rem + 1vw + 1.6vh, 2.6rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.035em; color: var(--av-navy-deep); text-wrap: balance; }
.dark .av-h1 { color: #fff; }
.av-desc { margin: 10px 0 0; font-size: 16.5px; line-height: 1.6; color: var(--av-text); }
.dark .av-desc { color: #cbd5e1; }

/* Cartão do formulário: superfície branca com borda suave (some no celular para ganhar espaço). */
.av-card--below { margin-top: clamp(1.1rem, 3vh, 1.75rem); }
@media (min-width: 640px) {
    .av-card { padding: clamp(1.25rem, 3vh, 1.85rem); border-radius: 22px; background: #fff; border: 1px solid var(--av-line); box-shadow: 0 1px 2px rgb(15 43 72 / .04), 0 24px 48px -28px rgb(15 43 72 / .28); }
    .dark .av-card { background: #0b1324; border-color: #1e293b; box-shadow: 0 24px 48px -28px rgb(0 0 0 / .7); }
}

.av-switch { margin: clamp(1rem, 2.6vh, 1.5rem) 0 0; text-align: center; font-size: 15px; color: #334155; }
.av-switch a { margin-left: 4px; font-weight: 700; color: var(--av-blue); text-decoration: underline; text-decoration-color: var(--av-sky-soft); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color .2s ease; }
.av-switch a:hover { color: var(--av-blue-deep); }
.dark .av-switch { color: #cbd5e1; }
.dark .av-switch a { color: var(--av-sky-soft); }
.av-legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: clamp(.9rem, 2.4vh, 1.5rem) 0 0; text-align: center; font-size: 13.5px; color: #64748b; }
.dark .av-legal { color: #94a3b8; }

/* ---------- Campos (padrão FormControl::auth e campos das telas de acesso) ---------- */
.av .av-card :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea)[class*="rounded"] {
    border-radius: 12px; border-color: #cbd5e1; background-color: #fff; color: var(--av-navy-deep); box-shadow: 0 1px 2px rgb(15 43 72 / .05);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.av .av-card :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select)[class*="rounded"]:not([maxlength="1"]) { min-height: 50px; }
.av .av-card :is(input, select, textarea)[class*="rounded"]:hover { border-color: #94a3b8; }
.av .av-card :is(input, select, textarea)[class*="rounded"]:focus { border-color: var(--av-blue); box-shadow: 0 0 0 4px rgb(56 189 248 / .22); outline: none; }
.av .av-card :is(input, select, textarea):is([aria-invalid="true"], .border-rose-400) { border-color: #f43f5e; }
.av .av-card :is(input, select, textarea):is([aria-invalid="true"], .border-rose-400):focus { box-shadow: 0 0 0 4px rgb(244 63 94 / .16); }
.dark .av .av-card :is(input:not([type=checkbox]):not([type=radio]), select, textarea)[class*="rounded"] { background-color: #0f172a; border-color: #334155; color: #f1f5f9; }
.dark .av .av-card :is(input, select, textarea)[class*="rounded"]:focus { border-color: var(--av-sky); }
.dark .av .av-card :is(input, select, textarea):is([aria-invalid="true"], .border-rose-400) { border-color: #fb7185; }
.av .av-card input[type=checkbox] { accent-color: var(--av-blue); color: var(--av-blue); border-radius: 6px; }
.av .av-card label { color: var(--av-navy-deep); }
.dark .av .av-card label { color: #e2e8f0; }

/* Links de apoio dentro do formulário (ex.: "Esqueci minha senha") */
.av .av-card a.text-accent-700 { color: var(--av-blue); text-decoration-color: var(--av-sky-soft); }
.av .av-card a.text-accent-700:hover { color: var(--av-blue-deep); }
.dark .av .av-card a.text-accent-700 { color: var(--av-sky-soft); }

/* ---------- Botão principal (x-auth.submit e envio do 2FA) ---------- */
.av .av-card button[type=submit]:is(.bg-accent-700, .bg-brand-600),
.av .av-card button[type=submit][class*="w-full"][class*="bg-"] {
    min-height: 52px; border-radius: 12px; background: var(--av-blue); color: #fff; border: 0;
    box-shadow: 0 14px 30px -12px rgb(3 105 161 / .6);
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s var(--av-ease);
}
.av .av-card button[type=submit]:is(.bg-accent-700, .bg-brand-600):hover,
.av .av-card button[type=submit][class*="w-full"][class*="bg-"]:hover { background: var(--av-blue-deep); box-shadow: 0 18px 36px -12px rgb(3 105 161 / .7); transform: translateY(-1px); }
.av .av-card button[type=submit]:focus-visible { outline: 2px solid var(--av-sky); outline-offset: 3px; }
/* Os atalhos de demonstração (só ambiente local) mantêm o visual próprio. */
.av #demo-login-panel button[type=submit] { min-height: 0; background: #fff; color: inherit; box-shadow: none; }

/* Botões sociais: mesmo raio e altura dos campos */
.av .av-card :is(a[href*="google"], a[href*="facebook"])[class*="rounded-xl"] { min-height: 50px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
    .av-back, .av-back svg, .av .av-card button[type=submit] { transition: none; }
    .av .av-card button[type=submit]:hover { transform: none; }
}

/* ---------- Telas largas: painel e formulário crescem juntos ---------- */
@media (min-width: 1536px) {
    .av-panel { width: 50%; }
    .av-form { max-width: 34rem; }
    .av-h1 { font-size: 2.9rem; }
    .av-desc { font-size: 17.5px; }
    .av-panel__card { width: min(22rem, 100%); }
}

/* Preenchimento automático do navegador: mantém o fundo branco do campo (sem o azul do Chrome). */
.av .av-card input:-webkit-autofill,
.av .av-card input:-webkit-autofill:hover,
.av .av-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--av-navy-deep);
    -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 1px 2px rgb(15 43 72 / .05) !important;
    box-shadow: 0 0 0 1000px #fff inset, 0 1px 2px rgb(15 43 72 / .05) !important;
    caret-color: var(--av-navy-deep);
    transition: background-color 9999s ease-out 0s;
}
.av .av-card input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 4px rgb(56 189 248 / .22) !important; box-shadow: 0 0 0 1000px #fff inset, 0 0 0 4px rgb(56 189 248 / .22) !important; }
.dark .av .av-card input:-webkit-autofill,
.dark .av .av-card input:-webkit-autofill:hover,
.dark .av .av-card input:-webkit-autofill:focus { -webkit-text-fill-color: #f1f5f9; -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important; box-shadow: 0 0 0 1000px #0f172a inset !important; caret-color: #f1f5f9; }

/* Chamada para criar conta (abaixo do login) */
.av-promo {
    display: flex; align-items: center; gap: 14px; margin-top: clamp(1rem, 2.6vh, 1.5rem); padding: 14px 14px 14px 16px;
    border-radius: 18px; border: 1px dashed #a5d8f3; background: linear-gradient(90deg, rgb(224 242 254 / .7), rgb(204 251 241 / .45));
}
.av-promo__icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--av-teal); box-shadow: 0 4px 12px -4px rgb(15 118 110 / .35); }
.av-promo p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.av-promo strong { font-size: 15px; font-weight: 700; color: var(--av-navy-deep); }
.av-promo span { font-size: 13.5px; color: var(--av-text); line-height: 1.4; }
.av-promo__btn {
    flex: none; display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 999px;
    background: #fff; border: 1px solid #bae6fd; color: var(--av-blue); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.av-promo__btn:hover { background: var(--av-blue); border-color: var(--av-blue); color: #fff; }
.av-promo__btn:focus-visible { outline: 2px solid var(--av-sky); outline-offset: 3px; }
.dark .av-promo { border-color: rgb(56 189 248 / .3); background: linear-gradient(90deg, rgb(3 105 161 / .16), rgb(15 118 110 / .14)); }
.dark .av-promo__icon { background: #0f172a; color: #5eead4; }
.dark .av-promo strong { color: #fff; }
.dark .av-promo span { color: #cbd5e1; }
.dark .av-promo__btn { background: transparent; border-color: rgb(125 211 252 / .45); color: var(--av-sky-soft); }
.dark .av-promo__btn:hover { background: var(--av-blue); color: #fff; }
@media (max-width: 420px) { .av-promo { flex-wrap: wrap; } .av-promo__btn { width: 100%; justify-content: center; } }

/* ======================================================================
 * Cartão único: título, formulário e chamada para criar conta no mesmo bloco
 * ==================================================================== */
.av-card__body { margin-top: 24px; }
.av-card__head + .av-card__body { margin-top: 26px; }
.av-card .av-h1 { font-size: clamp(1.75rem, 1rem + 1vw + 1vh, 2.3rem); }
.av-card .av-desc { font-size: 15.5px; margin-top: 8px; }
.av-card__foot { margin-top: 24px; }
.av-card__foot.av-switch { text-align: center; }
.av-card > .av-card__body:first-child { margin-top: 0; }

@media (min-width: 640px) {
    .av-card { padding: 0; overflow: hidden; border-radius: 24px; }
    .av-card__head { padding: clamp(1.5rem, 3.6vh, 2.25rem) clamp(1.5rem, 3vw, 2.4rem) 0; }
    .av-card__body { margin-top: 0; padding: clamp(1.25rem, 3vh, 1.75rem) clamp(1.5rem, 3vw, 2.4rem) clamp(1.5rem, 3.6vh, 2.25rem); }
    .av-card > .av-card__body:first-child { padding-top: clamp(1.5rem, 3.6vh, 2.25rem); }
    .av-card__head + .av-card__body { margin-top: 0; }
    .av-card__foot { margin: 0; padding: 16px clamp(1.5rem, 3vw, 2.4rem); border-top: 1px solid var(--av-line); background: linear-gradient(90deg, #f0f9ff, #f0fdfa); }
    .av-card__foot.av-promo { border-radius: 0; border-width: 1px 0 0; border-style: solid; border-color: var(--av-line); }
    .dark .av-card__foot { border-top-color: #1e293b; background: linear-gradient(90deg, rgb(3 105 161 / .12), rgb(15 118 110 / .1)); }
}
@media (min-width: 1536px) { .av-card .av-h1 { font-size: 2.5rem; } }

/* Chamada para criar conta: sólida, sem tracejado */
.av-promo { border-style: solid; border-color: #cfe8f6; }
.av-promo__btn { gap: 6px; background: var(--av-blue); border-color: var(--av-blue); color: #fff; box-shadow: 0 8px 18px -10px rgb(3 105 161 / .7); }
.av-promo__btn:hover { background: var(--av-blue-deep); border-color: var(--av-blue-deep); }
.av-promo__btn svg { transition: transform .2s var(--av-ease); }
.av-promo__btn:hover svg { transform: translateX(2px); }
.dark .av-promo__btn { background: var(--av-blue); border-color: var(--av-blue); color: #fff; }
/* O botão principal do formulário é o destaque; o "Criar conta" fica secundário em telas largas. */
@media (min-width: 640px) {
    .av-promo__btn { background: #fff; color: var(--av-blue); border-color: #bae6fd; box-shadow: none; }
    .av-promo__btn:hover { background: var(--av-blue); border-color: var(--av-blue); color: #fff; }
    .dark .av-promo__btn { background: transparent; color: var(--av-sky-soft); border-color: rgb(125 211 252 / .45); }
}

/* Linha "Senha" + "Esqueci minha senha" e "Manter conectado" */
.av-forgot { font-size: 14px; font-weight: 600; color: var(--av-blue); text-decoration: none; border-radius: 6px; }
.av-forgot:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--av-blue-deep); }
.dark .av-forgot { color: var(--av-sky-soft); }
.av-remember { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; color: #475569; }
.dark .av-remember { color: #cbd5e1; }
/* Ícones à esquerda dos campos acompanham o foco */
.av .av-card .relative:focus-within > span[aria-hidden] { color: var(--av-blue); }
.dark .av .av-card .relative:focus-within > span[aria-hidden] { color: var(--av-sky-soft); }
