/* ═══════════════════════════════════════════════════════════════
   auth.css — Shared styles for all authentication pages
   (LoginPage, RecuperarContaPage, VerificarCodigoPage, NovaConta)
   ═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    background-color: var(--background-color);
    padding: 20px;
    box-sizing: border-box;
}

/* ── Split card ───────────────────────────────────────────────── */
.login-split-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: clip;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ── Image panel ──────────────────────────────────────────────── */
.login-split-image {
    position: relative;
    min-height: 480px;
    width: 100%;
}

.login-split-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-split-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(59, 130, 246, 0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.overlay-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.auth-overlay-icon {
    font-size: 4rem;
    color: white;
    margin-bottom: 1rem;
}

.overlay-title {
    color: white;
    margin: 0;
}

.overlay-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.5rem;
}

/* ── Form panel ───────────────────────────────────────────────── */
.login-split-form {
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* Logo block (centered, used on recover/verify pages) */
.login-logo {
    text-align: center;
}

.nav-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form headings */
.auth-form-title {
    margin: 0.5rem 0 0.25rem;
}

.auth-form-subtitle {
    color: var(--text-secondary, #6B7280);
    margin: 0 0 1.5rem;
}

/* ── Back-to-landing link ─────────────────────────────────────── */
.login-header-links {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.25rem;
}

.login-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary, #325bb3);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.login-back-home:hover {
    opacity: 0.75;
    text-decoration: none;
}

/* Welcome title (login page only) */
.login-title {
    margin: 0.5rem 0 0.1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* ── Remember-me row ──────────────────────────────────────────── */
.remember-row {
    display: flex !important;
    align-items: center;
    margin: 1rem 0 !important;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.remember-label {
    color: var(--text-secondary);
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    margin: 0;
    flex: 1;
    min-width: fit-content;
}

/* ── Full-width auth button ───────────────────────────────────── */
.btn-auth {
    width: 100%;
}

/* ── Alert messages ───────────────────────────────────────────── */
.auth-alert {
    padding: 0.6rem;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* ── Back / resend link block ─────────────────────────────────── */
.auth-back-link {
    text-align: center;
    margin-top: 1.25rem;
}

/* ── Footer links (recovery, signup) ─────────────────────────── */
.auth-footer-links {
    margin-top: 0.75rem;
    text-align: center;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary, #325bb3);
    font-size: 0.875rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-link:hover {
    opacity: 0.75;
    text-decoration: none;
}

.signup-link {
    margin-top: 1rem;
    text-align: center;
}

.signup-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Brand footer ─────────────────────────────────────────────── */
.auth-footer-brand {
    text-align: center;
    margin-top: 1rem;
}

.auth-brand-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border, #E5E7EB);
}

.brand-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ── Loading overlay (used on login + dashboard redirect) ─────── */
.login-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.login-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.login-loading-logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(50, 91, 179, 0.25);
    animation: login-logo-pulse 1.5s ease-in-out infinite;
}

@keyframes login-logo-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.06); }
}

[data-theme="dark"] .login-loading-overlay {
    background: rgba(15, 23, 42, 0.92);
}

.login-loading-dots {
    display: flex;
    gap: 0.45rem;
}

.login-loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #325bb3;
    animation: login-dot-bounce 0.9s ease-in-out infinite;
}

.login-loading-dot:nth-child(1) { animation-delay: 0s; }
.login-loading-dot:nth-child(2) { animation-delay: 0.18s; background: #5c85cc; }
.login-loading-dot:nth-child(3) { animation-delay: 0.36s; background: #d4a853; }

@keyframes login-dot-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-10px); }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 968px) {
    .login-split-layout {
        grid-template-columns: 1fr !important;
        max-width: 500px;
    }

    .login-split-image {
        display: none !important;
    }

    .login-split-form {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .login-split-form {
        padding: 1.5rem 1rem;
    }

    .form-group {
        margin-bottom: 1rem !important;
    }

    .form-checkbox {
        min-width: 20px;
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   NovaConta — stepper, steps e componentes do multi-step form
   ═══════════════════════════════════════════════════════════════ */

/* Ocultar passos inativos */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: nc-fade-in 0.18s ease;
}

@keyframes nc-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Stepper ──────────────────────────────────────────────────── */
.nc-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.nc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: default;
    padding: 0;
    min-width: 0;
}

.nc-step.active,
.nc-step.completed {
    cursor: pointer;
}

.nc-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--surface-subtle);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.nc-step.active .nc-step-dot {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(50, 91, 179, 0.08);
}

.nc-step.completed .nc-step-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.nc-step-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.nc-step.active .nc-step-label {
    color: var(--primary);
    font-weight: 600;
}

.nc-step.completed .nc-step-label {
    color: var(--text-primary);
}

.nc-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.2rem;
    min-width: 16px;
    transition: background 0.2s;
}

.nc-step-line.done {
    background: var(--primary);
}

/* ── Labels ───────────────────────────────────────────────────── */
.nc-optional {
    font-size: 0.73rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Textarea ─────────────────────────────────────────────────── */
.nc-textarea {
    resize: vertical;
    min-height: 76px;
}

/* ── Switch group ─────────────────────────────────────────────── */
.nc-switch-group {
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.nc-switch-label {
    margin: 0 0 0.35rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Summary (passo 3) ────────────────────────────────────────── */
.nc-summary {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.nc-summary-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nc-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1rem;
}

.nc-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.nc-summary-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nc-summary-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

/* ── Termos ───────────────────────────────────────────────────── */
.nc-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.nc-terms-label {
    font-size: 0.84rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.nc-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nc-link:hover {
    opacity: 0.75;
}

/* ── Navegação ────────────────────────────────────────────────── */
.nc-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.nc-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nc-btn-back:hover {
    background: var(--surface-subtle);
    border-color: var(--text-secondary);
}

.nc-btn-next {
    flex: 1;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 968px) {
    .nc-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .nc-summary-grid {
        grid-template-columns: 1fr;
    }

    .nc-step-label {
        font-size: 0.62rem;
    }

    .nc-stepper {
        margin-bottom: 1rem;
    }
}
