/* ═══════════════════════════════════════════════════════════════
   auth.css — Shared styles for all authentication pages
   (LoginPage, RecuperarContaPage, VerificarCodigoPage, NovaConta)
   ═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    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: hidden;
    max-width: 1200px;
    width: 100%;
    margin: auto;
    align-self: center;
    min-height: min(600px, calc(100vh - 40px));
}

/* ── 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;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.login-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    color: var(--text-secondary, #6B7280);
    text-decoration: none;
    margin-bottom: 1rem;
    width: fit-content;
    transition: color .2s;
}
.login-back-link:hover {
    color: var(--primary-color, #4f46e5);
    text-decoration: none;
}
.login-back-link i {
    font-size: 1rem;
}

/* 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) {
    .auth-wrapper {
        align-items: center;
    }

    .login-split-layout {
        grid-template-columns: 1fr !important;
        max-width: 500px;
        min-height: unset;
    }

    .login-split-image {
        display: none !important;
    }

    .login-split-form {
        padding: 2rem;
        max-height: unset;
        overflow-y: visible;
    }
}

@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;
    }
}

/* ── Workspace Setup Options ─────────────────────────────────── */
.ws-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.ws-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--surface, #fff);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.1s;
}

.ws-option-card:hover:not(:disabled) {
    border-color: #325bb3;
    box-shadow: 0 2px 12px rgba(50, 91, 179, 0.12);
    transform: translateY(-1px);
}

.ws-option-card:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ws-option-icon {
    font-size: 1.75rem;
    color: #325bb3;
    flex-shrink: 0;
    width: 2.25rem;
    text-align: center;
}

.ws-demo-icon {
    color: #f59e0b;
}

.ws-option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ws-option-title {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.ws-option-desc {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.4;
}

.ws-option-arrow {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    flex-shrink: 0;
}

/* ── Workspace Setup — Tipo de Negócio grid ─────────────────── */
.ws-tipo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.ws-tipo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.75rem 0.85rem;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--surface, #fff);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.ws-tipo-card:hover {
    border-color: var(--tipo-color, #325bb3);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.ws-tipo-card.selected {
    border-color: var(--tipo-color, #325bb3);
    background: color-mix(in srgb, var(--tipo-color, #325bb3) 8%, var(--surface, #fff));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tipo-color, #325bb3) 20%, transparent);
}

.ws-tipo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--tipo-color, #325bb3) 15%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--tipo-color, #325bb3);
}

.ws-tipo-nome {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.ws-tipo-desc {
    font-size: 0.72rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ws-tipo-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--tipo-color, #325bb3);
    font-size: 1rem;
}

/* Template selector */
.ws-template-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ws-template-option.selected,
.ws-template-option:has(input:checked) {
    border-color: #325bb3;
    background: rgba(50, 91, 179, 0.06);
}

.ws-template-option input { accent-color: #325bb3; }

@media (max-width: 480px) {
    .ws-tipo-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH FLOW (.af-*) — shell partilhado das telas Login / Recuperar
   Acesso / Criar Conta, renderizado por AuthShell.razor.
   Cartao flutuante de tamanho FIXO e identico nas 3 telas; o painel
   do formulario rola por dentro se algum passo passar da altura.
   Cores sempre via tokens (--primary, --card-bg, --border, ...) →
   dark mode automatico. Layout no markup pode usar utilitarios tw-.
   As classes legadas acima (.login-split-*, .nc-*, .ws-*) continuam
   a servir WorkspaceSetupPage / VerificarCodigoPage / Logout.
   ═══════════════════════════════════════════════════════════════ */

.af-viewport {
    --af-card-w: 1000px;
    --af-card-h: 660px;
    --af-pink: #ec5ba6; /* acento decorativo (particulas) */
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    padding: 1.5rem;
    background: var(--background-color);
    box-sizing: border-box;
}

.af-card {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(var(--af-card-w), 100%);
    height: min(var(--af-card-h), calc(100dvh - 3rem));
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 60px -12px rgba(17, 24, 39, .22), 0 8px 24px -8px rgba(17, 24, 39, .12);
    overflow: hidden;
    animation: af-rise .6s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes af-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Painel de imagem / carrossel (esquerda) ──────────────────── */
.af-media {
    position: relative;
    flex: 0 0 44%;
    overflow: hidden;
    background: var(--primary);
    isolation: isolate;
}

.af-media__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1s ease-in-out, transform 6s ease-out;
}

.af-media__slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.af-media__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .12) 0%, rgba(15, 23, 42, .5) 58%, rgba(15, 23, 42, .82) 100%),
        linear-gradient(135deg, rgba(50, 91, 179, .5), rgba(140, 0, 89, .42));
}

.af-media__content {
    position: absolute;
    inset: auto 2.5rem 2.5rem 2.5rem;
    z-index: 2;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.af-media__eyebrow {
    margin: 0 0 .5rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .82);
}

.af-media__title {
    margin: 0 0 .6rem;
    font-size: 1.9rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.01em;
}

.af-media__text {
    margin: 0;
    font-size: .95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .88);
    max-width: 30ch;
}

.af-media__dots {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.af-media__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .4);
    transition: background .3s, height .3s;
}

.af-media__dot.is-active {
    height: 22px;
    background: #fff;
}

/* ── Painel do formulario (direita) ──────────────────────────── */
.af-panel {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(1.4rem, 1.6vw + .6rem, 2rem) clamp(1.75rem, 2.2vw + 1rem, 3rem);
    box-sizing: border-box;
}

.af-panel::-webkit-scrollbar { width: 6px; }
.af-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* Camada nao-rolavel para as particulas (clipada ao painel) */
.af-fx {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.af-panel__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 25rem;
    margin: auto; /* centra verticalmente quando o conteudo e curto */
}

/* Logo à esquerda, "Voltar ao site" à direita, na mesma linha */
.af-brand {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.af-brand__logo.df-logo { height: 2.35rem; }

@media (max-width: 600px) {
    .af-brand__logo.df-logo { height: 2.6rem; }
}

/* ── Voltar ao site ─────────────────────────────────────────── */
/* Logo clicável → página inicial (sem alteração visual) */
.af-brand__link {
    display: inline-block;
    text-decoration: none;
    border-radius: 8px;
}

.af-brand__link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Link discreto no topo do painel do formulário */
.af-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .15s ease, gap .15s ease;
}

.af-back:hover {
    color: var(--primary);
    gap: .6rem;
}

.af-back i { font-size: .95rem; }

/* Painel de imagem é um link para a landing */
a.af-media {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Chip "Voltar ao site" — surge no hover do painel de imagem */
.af-media__home {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .8rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}

a.af-media:hover .af-media__home,
a.af-media:focus-visible .af-media__home {
    opacity: 1;
    transform: translateY(0);
}

a.af-media:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .af-media__home { transition: opacity .2s ease; transform: none; }
    .af-back { transition: color .15s ease; }
}

.af-head { margin-bottom: .9rem; }

.af-head__title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text-primary);
}

.af-head__sub {
    margin: .3rem 0 0;
    font-size: .88rem;
    color: var(--text-secondary);
}

/* Versão no fim do painel, no fluxo normal: em telas altas fica depois do conteúdo em vez de o tapar. */
.af-versao {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin: .75rem 0 0;
    font-size: .72rem;
    text-align: center;
    color: var(--text-secondary);
    opacity: .75;
    pointer-events: none;
}

/* ── Campos ──────────────────────────────────────────────────── */
.af-form {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.af-field { display: block; }

.af-label {
    display: block;
    margin-bottom: .25rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Inputs compactos — só nas telas de auth (não toca no .form-input global) */
.af-form .form-input,
.af-form .form-select {
    padding-top: .5rem;
    padding-bottom: .5rem;
    font-size: .88rem;
}

.af-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    font-size: .85rem;
}

.af-check {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.af-check input { flex-shrink: 0; }

.af-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s;
}

.af-link:hover { opacity: .72; text-decoration: underline; }
.af-link--strong { font-weight: 700; }

/* ── Botao primario (gradiente derivado do token) ────────────── */
.af-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: .92rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background-image: linear-gradient(90deg,
        color-mix(in srgb, var(--primary) 78%, #000) 0%,
        var(--primary) 100%);
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 60%, transparent);
    transition: transform .18s, box-shadow .18s, filter .18s;
}

.af-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--primary) 65%, transparent);
    filter: brightness(1.06);
}

.af-submit:active:not(:disabled) { transform: translateY(0); }
.af-submit:disabled { opacity: .55; cursor: not-allowed; }

.af-footer {
    margin: 1rem 0 0;
    text-align: center;
    font-size: .875rem;
    color: var(--text-secondary);
}

/* ── Continuar com Google/Facebook ───────────────────────────── */
.af-social {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .85rem;
}

.af-social__sep {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .8rem;
    color: var(--text-secondary);
}

.af-social__sep::before,
.af-social__sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.af-social__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s;
}

.af-social__btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.af-social__nota {
    margin: 0;
    text-align: center;
    font-size: .75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.af-social__nota--campo { margin-top: .3rem; text-align: left; }

.af-social__texto {
    margin: 0 0 .85rem;
    font-size: .875rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

/* ── Alertas inline ──────────────────────────────────────────── */
.af-alert {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .65rem .8rem;
    border-radius: 8px;
    font-size: .83rem;
    line-height: 1.4;
}

.af-alert--error {
    background: color-mix(in srgb, var(--error, #ef4444) 12%, var(--card-bg));
    color: var(--error, #ef4444);
}

.af-alert--success {
    background: color-mix(in srgb, var(--success, #10b981) 14%, var(--card-bg));
    color: var(--success, #10b981);
}

/* ── Stepper (Criar Conta) ──────────────────────────────────── */
.af-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.af-stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}

.af-stepper__dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    border: 2px solid var(--border);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    transition: background .2s, border-color .2s, color .2s;
}

.af-stepper__label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.af-stepper__step.is-active .af-stepper__dot {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
    color: var(--primary);
}

.af-stepper__step.is-done .af-stepper__dot {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.af-stepper__step.is-active .af-stepper__label,
.af-stepper__step.is-done .af-stepper__label { color: var(--primary); }

.af-stepper__bar {
    flex: 0 1 68px;
    height: 2px;
    margin: 0 .6rem 1.05rem;
    background: var(--border);
    transition: background .25s;
}

.af-stepper__bar.is-done { background: var(--primary); }

.af-step {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    animation: af-step-in .22s ease;
}

@keyframes af-step-in {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.af-wizard-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: .3rem;
}

.af-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}

.af-btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* No wizard os botões são do tamanho do conteúdo (Criar não estica) */
.af-wizard-nav .af-submit,
.af-wizard-nav .af-btn-ghost {
    flex: 0 0 auto;
    width: auto;
    padding: .6rem 1.25rem;
    font-size: .88rem;
}

.af-terms {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .5rem 0 .15rem;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.af-terms input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.af-terms__btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* ── Cursor decorativo + particulas ─────────────────────────── */
.af-cursor {
    position: fixed;
    top: -60px;
    left: -60px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width .18s, height .18s, background .18s;
}

.af-cursor::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    transition: transform .18s;
}

.af-cursor.is-hover {
    width: 34px;
    height: 34px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.af-cursor.is-hover::after { transform: scale(0); }

.af-particle {
    position: absolute;
    top: -40px;
    z-index: 0;
    pointer-events: none;
    color: #9aa0a6; /* cinza neutro */
    filter: blur(2px);
}

[data-theme="dark"] .af-particle { color: #7b818c; }

.af-particle svg { width: 100%; height: 100%; display: block; }

@keyframes af-fall {
    0%   { transform: translateY(-40px) rotate(0);      opacity: 0; }
    14%  { opacity: .22; }
    86%  { opacity: .22; }
    100% { transform: translateY(680px) rotate(300deg); opacity: 0; }
}

@media (pointer: fine) {
    body.af-active,
    body.af-active a,
    body.af-active button,
    body.af-active input,
    body.af-active label,
    body.af-active .af-check { cursor: none; }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
    .af-cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .af-particle { display: none; }
    .af-card,
    .af-step,
    .af-media__slide { animation: none; transition: none; }
}

/* ── Dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] .af-card {
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .55), 0 8px 24px -8px rgba(0, 0, 0, .4);
}


/* ── Responsivo ─────────────────────────────────────────────── */

/* Tablet — cartão único, centrado, sem o painel de imagem */
@media (max-width: 968px) {
    .af-viewport {
        align-items: flex-start; /* + margin:auto no cartão → centra sem cortar o topo */
        padding: 1.5rem 1rem;
        overflow-y: auto;
    }

    .af-card {
        flex-direction: column;
        width: min(440px, 100%);
        height: auto;
        margin: auto;
        border-radius: 20px;
    }

    .af-media { display: none; }

    .af-panel {
        overflow: visible;
        padding: 2.25rem 1.75rem;
    }

    .af-panel__inner { max-width: none; }
}

/* Telemóvel — ecrã inteiro, sem cartão flutuante (mais legível / app-like) */
@media (max-width: 600px) {
    .af-viewport {
        align-items: stretch;
        padding: 0;
        min-height: 100dvh;
    }

    .af-card {
        width: 100%;
        min-height: 100dvh;
        height: auto;
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }

    [data-theme="dark"] .af-card { box-shadow: none; }

    .af-panel {
        justify-content: center;
        padding: clamp(2rem, 7vh, 4rem) 1.5rem 2.25rem;
    }

    .af-panel__inner { margin: auto; }
}

@media (max-width: 480px) {
    .af-panel { padding-left: 1.25rem; padding-right: 1.25rem; }
    .af-head__title { font-size: 1.5rem; }
    .af-head__sub { font-size: .9rem; }
    .af-label { font-size: .82rem; }
    .af-form .form-input,
    .af-form .form-select { font-size: .92rem; padding-top: .62rem; padding-bottom: .62rem; }
    .af-stepper__label { font-size: .66rem; }
    .af-wizard-nav { flex-wrap: wrap; }
    .af-wizard-nav .af-submit,
    .af-wizard-nav .af-btn-ghost {
        width: 100%;
        flex-basis: 100%;
        justify-content: center;
        padding-top: .7rem;
        padding-bottom: .7rem;
    }
    .af-wizard-nav .af-submit { order: -1; }
    /* Em ecrã estreito: Continuar e Saltar em cima, Voltar por baixo. */
    .af-wizard-nav__dir { order: -1; flex: 1 1 100%; flex-wrap: wrap; }
}

/* Escolha de género (Criar conta) */
.af-segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.af-segmented__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem .75rem;
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}

.af-segmented__opt:hover { border-color: var(--af-genero, var(--primary)); }

.af-segmented__opt.is-active {
    color: var(--af-genero, var(--primary));
    border-color: var(--af-genero, var(--primary));
    background: color-mix(in srgb, var(--af-genero, var(--primary)) 12%, transparent);
}

/* Feminino → rosa, masculino → azul */
.af-segmented__opt--feminino { --af-genero: #ec4899; }
.af-segmented__opt--masculino { --af-genero: #3b82f6; }

.af-required { color: var(--error); }

.af-loading {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

/* ── Assistente do dono (/configurar-workspace) ─────────────── */

/* Stepper de 4 passos: barras mais curtas para caber no painel */
.af-stepper--compacto .af-stepper__bar {
    flex-basis: 40px;
    margin-left: .35rem;
    margin-right: .35rem;
}

/* Voltar à esquerda; Saltar + Continuar juntos à direita */
.af-wizard-nav--entre { justify-content: space-between; }

.af-wizard-nav__dir {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Passo já feito no stepper: botão para voltar a ele */
.af-stepper__step--link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.af-stepper__step--link:hover .af-stepper__label { color: var(--primary); }

.af-stepper__step--link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 6px;
}

.af-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .5rem;
}

/* Valor calculado ao vivo (horas de trabalho) */
.af-calc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .65rem .85rem;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
    font-size: .83rem;
    color: var(--text-secondary);
}

.af-calc strong { color: var(--text-primary); font-weight: 600; }

.af-dica {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin: 0;
    font-size: .8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.af-dica i { color: var(--primary); margin-top: .05rem; }

/* Aviso ao saltar um passo (valores por omissão que ficam gravados) */
.af-aviso {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem .85rem;
    border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--warning) 10%, var(--card-bg));
}

.af-aviso__texto {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    font-size: .84rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.af-aviso__texto i { color: var(--warning); margin-top: .1rem; }

.af-aviso .af-wizard-nav { margin-top: 0; }

/* Resumo do passo "Pronto" */
.af-resumo {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.af-resumo__linha {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .85rem;
    font-size: .84rem;
}

.af-resumo__linha + .af-resumo__linha { border-top: 1px dashed var(--border); }

.af-resumo__linha dt { font-weight: 500; color: var(--text-secondary); }

.af-resumo__linha dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .af-stepper--compacto .af-stepper__bar { margin-left: .2rem; margin-right: .2rem; }
    .af-stepper--compacto .af-stepper__label { font-size: .6rem; }
    .af-grid-3 { grid-template-columns: 1fr 1fr; }
    .af-grid-3 > :last-child { grid-column: 1 / -1; }
}
