/* auth.css — login.ejs + esqueceu_senha.ejs */

/* ═══ TOKENS ═══════════════════════════════════════════════════ */
:root {
    --cfg-pri: #189889;
    --cfg-sec: #0095DA;
    --pri: #0098DA;
    --pri-dk: #006fa3;
    --pri-lt: #e0f4fd;
    --sec: #00C2FE;
    --text: #0f1f2e;
    --muted: #607d8b;
    --border: #dde6ec;
    --bg: #f4f8fb;
    --surface: #ffffff;
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, .06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, .10);
    --font-d: 'Bricolage Grotesque', sans-serif;
    --font-b: 'DM Sans', sans-serif;
    --t: .22s cubic-bezier(.4, 0, .2, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

html,
body {
    min-height: 100%;
    min-height: 100dvh;
    font-family: var(--font-b);
    -webkit-font-smoothing: antialiased;
}

body.auth-page {
    overflow-x: hidden;
}

@media (min-width: 901px) {
    html,
    body.auth-page {
        height: 100%;
        overflow: hidden;
    }
}

@media (max-width: 900px) {
    html,
    body.auth-page {
        overflow: auto;
    }
}

/* ═══ LAYOUT SPLIT ═════════════════════════════════════════════ */
.ls-root {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 900px) {
    .ls-root {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

/* Faixa brand compacta — mobile */
.ls-brand-mobile {
    display: none;
    background: linear-gradient(135deg, var(--pri) 0%, #0077b5 100%);
    padding: 1.25rem 1.5rem;
    padding-top: max(1.25rem, env(safe-area-inset-top));
}

.ls-brand-mobile-inner {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ls-brand-mobile img {
    height: 36px;
    filter: brightness(0) invert(1);
    object-fit: contain;
    flex-shrink: 0;
}

.ls-brand-mobile-text {
    font-size: .78rem;
    color: rgba(255, 255, 255, .85);
    line-height: 1.4;
}

.ls-brand-mobile-text strong {
    display: block;
    font-family: var(--font-d);
    font-size: .88rem;
    font-weight: 700;
    color: #fff;
}

@media (max-width: 900px) {
    .ls-brand-mobile {
        display: block;
    }
}

/* PAINEL ESQUERDO — brand desktop */
.ls-brand {
    position: relative;
    background: var(--pri);
    display: flex;
    flex-direction: column;
    padding: 3rem 3.5rem;
    overflow: hidden;
}

@media (max-width: 900px) {
    .ls-brand {
        display: none;
    }
}

@media (max-width: 1100px) and (min-width: 901px) {
    .ls-brand {
        padding: 2.5rem 2rem;
    }
}

.ls-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--pri) 0%, #0077b5 55%, #005a8a 100%);
}

.ls-brand::after {
    content: '';
    position: absolute;
    bottom: -180px;
    right: -180px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    pointer-events: none;
}

.brand-circle2 {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    pointer-events: none;
}

.brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.ls-brand > * {
    position: relative;
    z-index: 2;
}

.brand-logo img {
    height: 48px;
    filter: brightness(0) invert(1);
    opacity: .92;
    object-fit: contain;
}

.brand-footer {
    font-size: .72rem;
    color: rgba(255, 255, 255, .38);
    letter-spacing: .04em;
    line-height: 1.5;
}

/* Login — painel brand */
.brand-headline {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.brand-tagline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 1.2rem;
}

.brand-tagline::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    flex-shrink: 0;
}

.brand-headline h1 {
    font-family: var(--font-d);
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    letter-spacing: -.03em;
}

.brand-headline h1 em,
.brand-visual h2 em {
    font-style: normal;
    background: linear-gradient(90deg, #7dd3fc, #bae6fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-headline p,
.brand-visual p {
    font-size: .95rem;
    color: rgba(255, 255, 255, .68);
    line-height: 1.7;
    max-width: 340px;
}

.brand-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 99px;
    padding: 8px 16px;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(8px);
    animation: authFadeUp .5s cubic-bezier(.22, .61, .36, 1) both;
}

.stat-pill:nth-child(2) { animation-delay: .08s; }
.stat-pill:nth-child(3) { animation-delay: .16s; }
.stat-pill:nth-child(4) { animation-delay: .24s; }

.stat-pill i {
    font-size: .8rem;
    opacity: .85;
}

.brand-quote {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    border-left: 3px solid rgba(255, 255, 255, .5);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1.1rem 1.3rem;
    margin-top: 2.2rem;
}

.brand-quote p {
    font-size: .85rem;
    color: rgba(255, 255, 255, .8);
    line-height: 1.6;
    font-style: italic;
    max-width: none;
}

.brand-quote-author {
    font-size: .72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    margin-top: .6rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Esqueceu senha — painel brand */
.brand-visual {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
}

.brand-icon-wrap {
    position: relative;
    margin-bottom: 2rem;
}

.brand-icon-bg {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #fff;
    opacity: .92;
    backdrop-filter: blur(8px);
    animation: iconPop .6s .1s cubic-bezier(.22, .61, .36, 1) both;
}

.brand-icon-ping {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7dd3fc;
    border: 3px solid var(--pri);
    animation: ping 1.8s ease-in-out infinite;
}

.brand-visual h2 {
    font-family: var(--font-d);
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
}

.brand-visual p {
    margin-bottom: 2rem;
}

.brand-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 360px;
}

.brand-step {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    padding: .9rem 1.1rem;
    animation: stepIn .45s cubic-bezier(.22, .61, .36, 1) both;
}

.brand-step:nth-child(1) { animation-delay: .15s; }
.brand-step:nth-child(2) { animation-delay: .25s; }
.brand-step:nth-child(3) { animation-delay: .35s; }

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-d);
    font-size: .82rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.step-text {
    font-size: .84rem;
    color: rgba(255, 255, 255, .8);
    line-height: 1.4;
}

.step-text strong {
    color: #fff;
    font-weight: 700;
}

/* ═══ PAINEL FORMULÁRIO ════════════════════════════════════════ */
.ls-form-panel {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ls-form-wrap {
    width: 100%;
    max-width: 390px;
}

.form-logo-mobile {
    display: none;
}

@media (max-width: 900px) {
    .ls-form-panel {
        align-items: flex-start;
        padding: 1.75rem 1.25rem 2.5rem;
        min-height: calc(100dvh - 72px);
    }

    .form-logo-mobile {
        display: none;
    }
}

.form-head {
    margin-bottom: 1.75rem;
    animation: authFadeUp .5s .05s cubic-bezier(.22, .61, .36, 1) both;
}

.form-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pri);
    background: var(--pri-lt);
    padding: 5px 12px;
    border-radius: 99px;
    margin-bottom: 1rem;
}

.form-eyebrow::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pri);
    flex-shrink: 0;
}

.form-eyebrow-icon {
    font-size: .62rem;
    opacity: .85;
}

.form-head h2 {
    font-family: var(--font-d);
    font-size: clamp(1.45rem, 4vw, 1.75rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
    margin-bottom: .4rem;
    line-height: 1.2;
}

.form-head p {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.6;
}

.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 2.2rem 2rem 1.8rem;
    animation: authFadeUp .55s .1s cubic-bezier(.22, .61, .36, 1) both;
}

@media (max-width: 576px) {
    .form-card {
        padding: 1.5rem 1.25rem 1.35rem;
        border-radius: var(--radius-md);
    }

    .form-head {
        margin-bottom: 1.25rem;
    }
}

/* Dica e-mail — esqueceu senha */
.email-hint {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--pri-lt);
    border: 1px solid rgba(0, 152, 218, .2);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
}

.email-hint-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 152, 218, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pri);
    font-size: .9rem;
    flex-shrink: 0;
}

.email-hint p {
    font-size: .82rem;
    color: var(--pri-dk);
    line-height: 1.5;
    margin: 0;
}

/* Formulário Wappler */
.wf .form-label {
    font-size: .7rem !important;
    font-weight: 700 !important;
    letter-spacing: .09em !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
    margin-bottom: 7px !important;
    display: block;
}

.wf .form-control {
    background: var(--bg) !important;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font-b) !important;
    font-size: .93rem !important;
    padding: 11px 14px !important;
    min-height: 48px;
    transition: border-color var(--t), background var(--t), box-shadow var(--t) !important;
}

@media (max-width: 576px) {
    .wf .form-control {
        font-size: 16px !important;
    }
}

.wf .form-control::placeholder {
    color: #b0bec5 !important;
}

.wf .form-control:focus {
    border-color: var(--pri) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(0, 152, 218, .13) !important;
    outline: none !important;
}

.wf .input-group-spaced {
    margin-top: 7px;
}

.wf .input-group .form-control {
    border-right: none !important;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}

.wf .input-group-text {
    background: var(--bg) !important;
    border: 2px solid var(--border) !important;
    border-left: none !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    color: var(--muted) !important;
    cursor: pointer;
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t), border-color var(--t) !important;
}

.wf .input-group-text:hover {
    color: var(--pri) !important;
}

.wf .input-group:focus-within .form-control,
.wf .input-group:focus-within .input-group-text {
    border-color: var(--pri) !important;
}

.wf .input-group:focus-within .form-control {
    background: #fff !important;
}

.wf a small {
    color: var(--pri) !important;
    font-weight: 600;
    font-size: .8rem;
}

.wf a:hover small {
    opacity: .75;
}

.wf .form-check-input {
    accent-color: var(--pri);
    width: 18px;
    height: 18px;
    margin-top: .1rem;
}

.wf .form-check-label {
    font-size: .84rem !important;
    color: var(--muted) !important;
    cursor: pointer;
    padding-left: .25rem;
}

.wf .btn-success {
    background: var(--pri) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 13px !important;
    min-height: 48px;
    font-family: var(--font-d) !important;
    font-size: .97rem !important;
    font-weight: 800 !important;
    letter-spacing: .05em !important;
    color: #fff !important;
    position: relative;
    overflow: hidden;
    transition: background var(--t), transform .2s, box-shadow .2s !important;
}

.wf .btn-success:hover {
    background: var(--pri-dk) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 28px rgba(0, 152, 218, .32) !important;
}

.wf .btn-success:active {
    transform: translateY(0) !important;
}

.wf .btn-success:disabled {
    opacity: .65 !important;
    transform: none !important;
    box-shadow: none !important;
}

.wf .btn-success::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
    transform: skewX(-18deg);
    transition: left .55s ease;
    pointer-events: none;
}

.wf .btn-success:hover::after {
    left: 160%;
}

.wf .mb-3:nth-child(2) { animation: authFadeUp .4s .15s both; }
.wf .mb-3:nth-child(3) { animation: authFadeUp .4s .22s both; }
.wf .mb-3:nth-child(4) { animation: authFadeUp .4s .29s both; }
.wf .btn-success { animation: authFadeUp .4s .36s both; }

.auth-page--recover .wf .mb-3:nth-child(2) { animation: authFadeUp .4s .18s both; }
.auth-page--recover .wf .btn-success { animation: authFadeUp .4s .26s both; }

.card-divider {
    height: 1px;
    background: var(--border);
    margin: 1.4rem 0;
}

.form-card-footer {
    text-align: center;
    font-size: .84rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.form-card-footer a {
    color: var(--pri);
    font-weight: 700;
    text-decoration: none;
}

.form-card-footer a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--pri);
    text-decoration: none;
    min-height: 44px;
    transition: gap var(--t), opacity var(--t);
}

.back-link:hover {
    gap: 10px;
    opacity: .8;
    color: var(--pri);
}

.back-link i {
    font-size: .82rem;
    transition: transform var(--t);
}

.back-link:hover i {
    transform: translateX(-3px);
}

.trust-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    animation: authFadeUp .4s .48s both;
}

.tchip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .7rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 6px 12px;
    box-shadow: var(--shadow-sm);
}

.tchip i {
    color: var(--pri);
    font-size: .68rem;
}

.session-hidden {
    display: none;
}

/* Resetar senha — dicas e força */
.brand-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.brand-tip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    padding: .85rem 1.1rem;
    animation: stepIn .45s cubic-bezier(.22, .61, .36, 1) both;
}

.brand-tip:nth-child(1) { animation-delay: .15s; }
.brand-tip:nth-child(2) { animation-delay: .25s; }
.brand-tip:nth-child(3) { animation-delay: .35s; }
.brand-tip:nth-child(4) { animation-delay: .45s; }

.tip-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    color: #bae6fd;
    flex-shrink: 0;
}

.tip-text {
    font-size: .83rem;
    color: rgba(255, 255, 255, .8);
    line-height: 1.4;
}

.tip-text strong {
    color: #fff;
    font-weight: 700;
}

.strength-wrap {
    margin-top: 8px;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 5px;
}

.strength-bar span {
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    transition: background .3s;
}

.strength-label {
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
}

.auth-page--reset .wf .mb-3:nth-child(3) { animation: authFadeUp .4s .22s both; }
.auth-page--reset .wf .mb-3:nth-child(4) { animation: authFadeUp .4s .29s both; }
.auth-page--reset .wf .btn-success { animation: authFadeUp .4s .36s both; }

/* ═══ ANIMAÇÕES ════════════════════════════════════════════════ */
@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes iconPop {
    from { opacity: 0; transform: scale(.7) rotate(-8deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes ping {
    0%, 100% { transform: scale(1); opacity: 1; }
    60% { transform: scale(1.5); opacity: 0; }
}

@keyframes stepIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .stat-pill,
    .brand-step,
    .brand-icon-bg,
    .form-head,
    .form-card,
    .wf .mb-3,
    .wf .btn-success,
    .trust-chips {
        animation: none !important;
    }

    .brand-icon-ping {
        animation: none;
    }

    .wf .btn-success:hover {
        transform: none !important;
    }
}

/* ═══ MOBILE PEQUENO ════════════════════════════════════════════ */
@media (max-width: 380px) {
    .ls-form-panel {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .trust-chips {
        gap: 6px;
    }

    .tchip {
        font-size: .65rem;
        padding: 5px 10px;
    }

    .brand-stats {
        gap: 8px;
    }

    .stat-pill {
        font-size: .72rem;
        padding: 6px 12px;
    }
}
