/* Telas sem login (layouts/public.html): Entrar e Cadastro. Fundo decorado, cartão
   central, campos grandes e avisos dentro do cartão. Foco de campo = só a borda roxa
   fina (mesma regra de core/app/forms.css). */

body.auth { background: var(--c-ground); }
.auth-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* ---- Enfeites do fundo (features/auth/decor.html) ------------------------- */
.auth-decor { position: absolute; top: 0; bottom: 0; width: min(32vw, 420px); pointer-events: none; }
.auth-decor--right { right: 0; }
.auth-decor--left { left: 0; width: min(26vw, 340px); }
.auth-waves { width: 100%; height: 100%; display: block; }
.auth-decor--left .auth-waves { transform: scaleX(-1); }
.auth-deco {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    border: 2px solid var(--t-bd);
    color: var(--t-fg);
    display: grid;
    place-items: center;
    transform: rotate(var(--rot, 0deg));
    box-shadow: 0 12px 26px rgba(4, 40, 42, .28);
}
.auth-deco .ms { font-size: 32px; }
.auth-deco.t-amber { background: #fff4cc; }
.auth-deco.t-pink { background: #fde7f1; }
.auth-deco.t-blue { background: #dbeafe; }
.auth-deco.t-orange { background: #ffedd5; }
.auth-deco.t-cyan { background: #dcf5fc; }
.auth-decor--right .auth-deco--1 { top: 16%; right: 12%; }
.auth-decor--right .auth-deco--2 { top: 44%; right: 6%; }
.auth-decor--right .auth-deco--3 { top: 70%; right: 16%; }
.auth-decor--left .auth-deco--1 { top: 18%; left: 8%; }
.auth-decor--left .auth-deco--2 { top: 46%; left: 4%; }
.auth-decor--left .auth-deco--3 { top: 72%; left: 12%; }

.auth-dots { position: absolute; width: 155px; height: 98px; opacity: .85; background-size: 25px 26px; pointer-events: none; }
.auth-dots--login-1 { top: 12%; left: 6%; background-image: radial-gradient(#f4a6c9 2.5px, transparent 2.5px); }
.auth-dots--login-2 { bottom: 10%; right: 34%; background-image: radial-gradient(#f5d565 2.5px, transparent 2.5px); }
.auth-dots--cadastro-1 { top: 14%; right: 8%; background-image: radial-gradient(#f5d565 2.5px, transparent 2.5px); }
.auth-dots--senha-1 { top: 12%; left: 6%; background-image: radial-gradient(#fdba74 2.5px, transparent 2.5px); }
.auth-tile { position: absolute; width: 120px; height: 120px; border-radius: 32px; border: 2px solid; pointer-events: none; }
.auth-tile--login { bottom: 14%; left: 9%; background: #dcf5fc; border-color: #86d7ee; transform: rotate(12deg); }
.auth-tile--cadastro { bottom: 12%; right: 7%; background: #ede7ff; border-color: #c4b5fd; transform: rotate(-10deg); }
.auth-tile--senha { bottom: 14%; left: 9%; background: #ede7ff; border-color: #c4b5fd; transform: rotate(12deg); }

/* ---- Cartão --------------------------------------------------------------- */
.auth-main { position: relative; z-index: 2; width: 100%; max-width: 500px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-main.is-wide { max-width: 640px; }
.auth-logo { height: 44px; width: auto; }
.auth-card {
    width: 100%;
    padding: 34px 38px 30px;
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--c-line);
    box-shadow: 0 18px 48px rgba(11, 79, 82, .12);
}
.auth-head { text-align: center; }
.auth-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--c-teal-bg);
    color: var(--c-teal);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px rgba(26, 170, 176, .12);
}
.auth-badge img { width: 36px; height: 36px; object-fit: contain; }
.auth-badge .ms { font-size: 32px; }
.auth-title { margin: 6px 0 22px; color: var(--c-teal); font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.25; }
.auth-title:focus { outline: none; }
.auth-text { margin: 0 0 20px; font-size: 16px; line-height: 1.6; color: var(--c-soft); text-align: center; }
.auth-foot { margin: 22px 0 0; font-size: 15px; color: var(--c-muted); text-align: center; }
.auth-foot a, .auth-copy a { font-weight: 600; }
.auth-copy { margin: 0; font-size: 13px; color: var(--c-muted); text-align: center; }

/* ---- Campos ----------------------------------------------------------------- */
.auth-form { display: flex; flex-direction: column; gap: 18px; text-align: left; }
.auth-label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 600; color: var(--c-soft); }
.auth-req { color: #b91c1c; }
.auth-help { margin: 6px 0 0; font-size: 13px; color: var(--c-muted); }
.auth-help.is-error { color: #b91c1c; font-weight: 600; }
.auth-help.is-warn { color: #9a3412; font-weight: 600; }

/* Campo com ícone (Entrar): a borda fica no contorno, o input por dentro */
.auth-field {
    display: flex;
    align-items: center;
    height: 58px;
    border: 2px solid #c4dcda;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(11, 79, 82, .06);
    transition: border-color .15s;
}
.auth-field:focus-within { border-color: var(--c-purple-ring); }
.auth-field.is-error { border-color: #dc2626; }
.auth-field > .ms { margin-left: 14px; color: #0f6f73; }
.auth-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 12px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 17px;
    color: var(--c-strong);
}
.auth-field input::placeholder { color: #64748b; }
.auth-eye {
    height: 44px;
    margin-right: 6px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--c-teal);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.auth-eye:hover { background: var(--c-purple-bg); color: var(--c-purple); }
.auth-eye .ms { font-size: 20px; }

/* Campo simples (Cadastro) */
.auth-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 2px solid #d4e3eb;
    border-radius: 16px;
    background: #fff;
    font-size: 16px;
    color: var(--c-strong);
    box-shadow: 0 4px 16px rgba(72, 107, 135, .05);
    transition: border-color .15s;
}
.auth-input::placeholder { color: #64748b; }
.auth-input:focus { outline: none; border-color: var(--c-purple-ring); }
.auth-input.is-error { border-color: #dc2626; }
.auth-ferr { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #b91c1c; }
.auth-ferr .ms { font-size: 18px; }

.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--c-soft); cursor: pointer; }
.auth-check input { width: 20px; height: 20px; accent-color: var(--c-purple); }
.auth-link {
    min-height: 44px; /* mesma altura do "Lembrar de mim" ao lado: alvo de toque */
    padding: 4px 2px;
    border: none;
    background: none;
    color: #0f6f73;
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.auth-back { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* ---- Botões grandes ------------------------------------------------------ */
.auth-submit {
    width: 100%;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 18px;
    background: var(--c-purple);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(77, 36, 202, .26);
    transition: transform .15s, box-shadow .15s, background .15s;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-2px); background: var(--c-purple-dark); box-shadow: 0 14px 30px rgba(77, 36, 202, .32); }
.auth-submit:disabled { opacity: .8; cursor: progress; }
.auth-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.auth-actions .btn { min-height: 56px; padding: 0 24px; border-radius: 18px; font-size: 17px; font-weight: 700; }
.auth-actions .btn:disabled { opacity: .8; cursor: progress; }
.auth-spin { animation: auth-spin 1s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---- Avisos dentro do cartão --------------------------------------------- */
.auth-alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px 16px; border-radius: 16px; font-size: 15px; line-height: 1.5; text-align: left; }
.auth-alert strong { display: block; }
.auth-alert-ic { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.auth-alert-ic .ms { font-size: 20px; }
.auth-alert--error { background: #fee2e2; border: 1px solid #fca5a5; }
.auth-alert--error strong { color: #991b1b; }
.auth-alert--error .auth-alert-ic { background: #b91c1c; }
.auth-alert--info { background: #eff5ff; border: 1px solid #cfe0ff; }
.auth-alert--info strong { color: #1e40af; }
.auth-alert--info .auth-alert-ic { background: #1e40af; }
.auth-alert--warn { background: #fff7ed; border: 1px solid #fdba74; }
.auth-alert--warn strong { color: #9a3412; }
.auth-alert--warn .auth-alert-ic { background: #c2410c; }

/* ---- Etapas do cadastro ---------------------------------------------------- */
.auth-steps { list-style: none; margin: 0 0 26px; padding: 0; display: flex; gap: 12px; }
.auth-step { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--c-line); }
.auth-step.is-current { background: var(--c-purple-bg); border-color: var(--c-purple-ring); }
.auth-step.is-done { background: #dcf7e6; border-color: #9fdfb8; }
.auth-step-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; background: #eef2f6; color: var(--c-muted); }
.auth-step-dot .ms { font-size: 20px; }
.auth-step.is-current .auth-step-dot { background: var(--c-purple); color: #fff; }
.auth-step.is-done .auth-step-dot { background: #15803d; color: #fff; }
.auth-step-text { display: flex; flex-direction: column; }
.auth-step-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #47657d; }
.auth-step-label { font-size: 16px; font-weight: 700; color: var(--c-strong); }
.auth-panel { min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-actions-gap { flex: 1; }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.auth-grid .is-wide { grid-column: 1 / -1; }
.auth-legend { margin: 16px 0 0; font-size: 13px; color: var(--c-muted); }

/* Regras da senha nova (Definir senha): cada uma fica verde quando cumprida */
.auth-rules { list-style: none; margin: -4px 0 0; padding: 14px 16px; border-radius: 16px; background: #dbeafe; border: 1px solid #93c5fd; display: flex; flex-direction: column; gap: 8px; }
.auth-rule { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #1e3a8a; }
.auth-rule .ms { font-size: 20px; }
.auth-rule.is-ok { color: #14532d; }

/* Cadastro concluído (também usado em Definir senha) */
.auth-done { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 0; text-align: center; }
.auth-done-ic { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: #dcf7e6; border: 2px solid #9fdfb8; color: #14532d; }
.auth-done-ic .ms { font-size: 44px; }
.auth-done-ic--warn { background: #ffedd5; border-color: #fdba74; color: #9a3412; }
.auth-done .auth-title { margin: 0; }
.auth-done .auth-text { max-width: 460px; margin: 0; font-size: 17px; }
.auth-done .auth-alert { max-width: 460px; margin: 0; }
.auth-done .btn { min-height: 56px; padding: 0 24px; border-radius: 18px; font-size: 17px; font-weight: 700; }

/* ---- Telas estreitas: sem enfeites, cartão mais compacto ------------------ */
@media (max-width: 960px) {
    .auth-decor, .auth-dots, .auth-tile { display: none; }
}
@media (max-width: 560px) {
    .auth-page { padding: 24px 12px; }
    .auth-card { padding: 26px 20px 22px; border-radius: 24px; }
    .auth-title { font-size: 26px; }
    .auth-steps { flex-direction: column; }
    .auth-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-spin { animation: none; }
}
