/* ════════════════════════════════════════════
   Auth — Login + Reset Password
   Escopo: .auth-page
   ════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
    --auth-blue:       #2563eb;
    --auth-blue-dk:    #1d4ed8;
    --auth-blue-lt:    #dbeafe;
    --auth-cyan:       #0ea5e9;
    --auth-green:      #10b981;
    --auth-red:        #ef4444;
    --auth-amber:      #f59e0b;

    --auth-ink:        #0f172a;
    --auth-ink-2:      #1e293b;
    --auth-dark:       #020617;
    --auth-card:       #0f172a;
    --auth-input-bg:   #1e293b;
    --auth-input-foc:  #253350;

    --auth-text:       #f8fafc;
    --auth-text-2:     #94a3b8;
    --auth-muted:      #64748b;

    --auth-border:     rgba(255,255,255,.08);
    --auth-border-lt:  rgba(255,255,255,.14);

    --auth-grad-right: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5e9 100%);
    --auth-grad-brand: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    --auth-radius:     10px;
    --auth-radius-sm:  7px;
    --auth-ease:       cubic-bezier(.22, 1, .36, 1);
}

/* ── Reset de escopo ────────────────────────────────────────────── */
.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Layout split ───────────────────────────────────────────────── */
.auth-page {
    display: flex;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Lado esquerdo ──────────────────────────────────────────────── */
.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--auth-dark);
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: auth-fade-in .5s var(--auth-ease) both;
}

/* ── Brand ──────────────────────────────────────────────────────── */
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    text-decoration: none;
    margin-bottom: .5rem;
}

.auth-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--auth-grad-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(102,126,234,.35);
}

.auth-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -.02em;
}

.auth-brand-name em {
    color: #818cf8;
    font-style: normal;
}

/* ── Heading ────────────────────────────────────────────────────── */
.auth-heading h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -.04em;
    line-height: 1.1;
    margin-bottom: .5rem;
}

.auth-heading p {
    color: var(--auth-text-2);
    font-size: .9375rem;
    line-height: 1.6;
}

/* ── Icon header (reset pages) ──────────────────────────────────── */
.auth-icon-header {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.auth-icon-circle-blue  { background: rgba(37,99,235,.15); color: #60a5fa; border: 1px solid rgba(37,99,235,.2); }
.auth-icon-circle-green { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.2); }

/* ── Alerts ─────────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem;
    border-radius: var(--auth-radius-sm);
    font-size: .875rem;
    animation: auth-slide-in .3s var(--auth-ease) both;
}

.auth-alert i { font-size: 1.125rem; flex-shrink: 0; margin-top: .0625rem; }

.auth-alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25);  color: #fca5a5; }
.auth-alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: #6ee7b7; }
.auth-alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); color: #93c5fd; }

.auth-alert strong { display: block; margin-bottom: .25rem; font-weight: 700; }
.auth-alert p      { margin: 0; opacity: .9; font-size: .8125rem; }

/* ── Formulário ─────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: .4375rem;
}

.auth-field label {
    display: flex;
    align-items: center;
    gap: .4375rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--auth-text-2);
}

.auth-field label i { color: #60a5fa; font-size: .9375rem; }

.auth-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-field-link {
    font-size: .8125rem;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    transition: color .2s;
}

.auth-field-link:hover { color: var(--auth-text); }

/* Input */
.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    font-size: .9375rem;
    font-family: inherit;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.auth-input::placeholder { color: var(--auth-muted); }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-blue);
    background: var(--auth-input-foc);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.auth-input.is-error {
    border-color: var(--auth-red);
}

.auth-input.is-error:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}

/* Input com botão de toggle */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap .auth-input { padding-right: 2.75rem; }

.auth-toggle-pw {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    color: var(--auth-muted);
    cursor: pointer;
    padding: .25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color .2s;
}

.auth-toggle-pw:hover { color: var(--auth-text-2); }
.auth-toggle-pw i { font-size: 1rem; }

/* Field help */
.auth-field-help {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
    color: var(--auth-muted);
}

.auth-field-help i { font-size: .75rem; }

/* Field error */
.auth-field-error {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
    color: #fca5a5;
}

/* Remember me */
.auth-remember { display: flex; align-items: center; }

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--auth-text-2);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

/* ── Botões ─────────────────────────────────────────────────────── */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .8125rem 1.5rem;
    border-radius: var(--auth-radius-sm);
    font-size: .9375rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform .2s var(--auth-ease), box-shadow .2s, background .2s, opacity .2s;
    white-space: nowrap;
    width: 100%;
    justify-content: center;
}

.auth-btn i { font-size: 1rem; }

.auth-btn-primary {
    background: var(--auth-blue);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,99,235,.35);
}

.auth-btn-primary:hover {
    background: var(--auth-blue-dk);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,.45);
    color: #fff;
}

.auth-btn-primary:active { transform: translateY(0); }

.auth-btn-primary.is-loading {
    pointer-events: none;
    opacity: .7;
}

.auth-btn-outline {
    background: transparent;
    color: var(--auth-text);
    border: 1px solid var(--auth-border-lt);
}

.auth-btn-outline:hover {
    background: var(--auth-input-bg);
    border-color: var(--auth-blue);
    color: #60a5fa;
}

/* Loading spinner no botão */
.auth-btn.is-loading::after {
    content: '';
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
    margin-left: .25rem;
}

/* ── Info box ───────────────────────────────────────────────────── */
.auth-info-box {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: 1rem 1.125rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
}

.auth-info-box-icon {
    width: 40px; height: 40px;
    border-radius: 9px;
    background: rgba(37,99,235,.15);
    border: 1px solid rgba(37,99,235,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.auth-info-box strong {
    display: block;
    font-size: .875rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: .25rem;
}

.auth-info-box p {
    font-size: .8125rem;
    color: var(--auth-text-2);
    line-height: 1.5;
    margin: 0;
}

/* ── Barra de força de senha ────────────────────────────────────── */
.auth-strength {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.auth-strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--auth-border);
    overflow: hidden;
}

.auth-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width .3s var(--auth-ease), background .3s;
}

.auth-strength-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--auth-muted);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* ── Requisitos de senha ────────────────────────────────────────── */
.auth-requirements {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

.req-item {
    display: flex;
    align-items: center;
    gap: .4375rem;
    font-size: .8125rem;
    color: var(--auth-muted);
    transition: color .2s;
}

.req-item i { font-size: .875rem; transition: color .2s; }

.req-item.is-met {
    color: #34d399;
}

.req-item.is-met i {
    /* substitui bi-circle por bi-check-circle-fill via classe JS */
}

/* ── Seção de sucesso ───────────────────────────────────────────── */
.auth-success-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.auth-success-icon {
    width: 80px; height: 80px;
    margin: 0 auto;
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: #34d399;
    animation: auth-success-pop .5s var(--auth-ease) both;
}

.auth-success-section h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -.04em;
}

.auth-success-section p {
    color: var(--auth-text-2);
    font-size: .9375rem;
    line-height: 1.6;
    max-width: 360px;
    margin: 0 auto;
}

/* ── Instruções (check_email) ───────────────────────────────────── */
.auth-instructions {
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 1.25rem;
}

.auth-instructions h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 1rem;
}

.auth-instruction-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.auth-instruction-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--auth-text-2);
    font-size: .9rem;
}

.auth-instruction-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(37,99,235,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: .9rem;
    flex-shrink: 0;
}

/* ── Reenvio ────────────────────────────────────────────────────── */
.auth-resend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .875rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
}

.auth-resend p {
    color: var(--auth-text-2);
    font-size: .9rem;
}

.auth-resend .auth-btn {
    width: auto;
    padding: .625rem 1.25rem;
}

/* ── Link de rodapé ─────────────────────────────────────────────── */
.auth-footer-link {
    text-align: center;
}

.auth-footer-link a {
    display: inline-flex;
    align-items: center;
    gap: .4375rem;
    color: var(--auth-muted);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}

.auth-footer-link a:hover { color: var(--auth-text-2); }
.auth-footer-link i { font-size: .875rem; }

/* ══════════════════════════════════════════
   LADO DIREITO — VISUAL
══════════════════════════════════════════ */
.auth-right {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-grad-right);
    overflow: hidden;
}

.auth-visual {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    z-index: 1;
}

/* Orbs de fundo */
.auth-right-orb {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
    animation: auth-float 18s ease-in-out infinite;
}

.auth-right-orb-1 {
    width: 420px; height: 420px;
    top: -120px; right: -120px;
    animation-delay: 0s;
}

.auth-right-orb-2 {
    width: 300px; height: 300px;
    bottom: -80px; left: -60px;
    animation-delay: -7s;
}

.auth-visual-content {
    max-width: 440px;
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-visual-logo {
    width: 80px; height: 80px;
    margin: 0 auto;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: #fff;
    backdrop-filter: blur(8px);
    animation: auth-float 6s ease-in-out infinite;
}

.auth-visual-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.04em;
    line-height: 1.1;
}

.auth-visual-content > p {
    color: rgba(255,255,255,.75);
    font-size: 1rem;
    line-height: 1.7;
}

/* Features (login) */
.auth-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .875rem;
    text-align: left;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: .875rem;
    color: rgba(255,255,255,.88);
    font-size: .9375rem;
    font-weight: 500;
}

.auth-feature-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

/* Stats */
.auth-visual-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.auth-stat {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    padding: 1rem .75rem;
    backdrop-filter: blur(8px);
}

.auth-stat strong {
    display: block;
    font-size: 1.375rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.03em;
    line-height: 1;
    margin-bottom: .25rem;
}

.auth-stat span {
    font-size: .6875rem;
    color: rgba(255,255,255,.65);
    font-weight: 500;
}

/* Steps (request) */
.auth-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.auth-steps li {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    color: rgba(255,255,255,.85);
}

.auth-step-num {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6875rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .05em;
    flex-shrink: 0;
}

.auth-steps li strong { display: block; font-size: .9375rem; color: #fff; margin-bottom: .125rem; }
.auth-steps li p      { font-size: .8125rem; color: rgba(255,255,255,.6); margin: 0; }

/* Tips (request) */
.auth-visual-tips {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.auth-tip {
    display: flex;
    align-items: center;
    gap: .625rem;
    color: rgba(255,255,255,.82);
    font-size: .875rem;
}

.auth-tip i { color: #34d399; font-size: 1rem; }

/* Security items (reset + check_email) */
.auth-security-items {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    text-align: left;
}

.auth-security-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255,255,255,.85);
    font-size: .9375rem;
}

.auth-security-item i { color: #34d399; font-size: 1.125rem; }

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */
@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes auth-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes auth-float {
    0%,100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(20px, -20px) scale(1.05); }
    66%      { transform: translate(-14px, 14px) scale(.96); }
}

@keyframes auth-success-pop {
    0%   { opacity: 0; transform: scale(.7); }
    70%  { transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   RESPONSIVO
══════════════════════════════════════════ */
@media (max-width: 992px) {
    .auth-right { display: none; }
    .auth-left  { flex: 1; }
}

@media (max-width: 480px) {
    .auth-left { padding: 1.25rem; }

    .auth-container { gap: 1.25rem; }

    .auth-heading h1 { font-size: 1.5rem; }

    .auth-visual-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
