/* ================================================================
   ONBOARDING MODAL — Visual Card Grid Design
   ================================================================ */

/* ── Modal shell ─────────────────────────────────────────────── */
.onboarding-modal .modal-dialog {
    max-width: 680px;
}

.onboarding-modal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.onboarding-modal .modal-body {
    padding: 0 !important;
}

/* ── Page wrapper ────────────────────────────────────────────── */
.onboarding-page {
    position: relative;
    padding: 2rem 2rem 2.5rem;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: #fff;
}

/* ── Step indicator ──────────────────────────────────────────── */
.step-indicator {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-primary, #4361ee);
    opacity: 0.75;
    margin-bottom: -0.25rem;
}

/* ── Back button ─────────────────────────────────────────────── */
.back-btn {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}

.back-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ── Header text ─────────────────────────────────────────────── */
.header-text {
    text-align: center;
    padding: 0 0.5rem;
}

.header-text h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.header-text p {
    font-size: 0.92rem;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.5;
}

/* ── Card option grid — flex so odd last rows are centered ───── */
.grid-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.visual-card {
    flex: 0 0 140px;        /* fixed width; flex-wrap handles rows  */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.1rem 0.75rem;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
    user-select: none;
    -webkit-user-select: none;
}

.visual-card:hover {
    border-color: var(--bs-primary, #4361ee);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.14);
    transform: translateY(-2px);
    background: #f8f9ff;
}

.visual-card:active {
    transform: translateY(0);
    box-shadow: none;
}

.visual-card .fas {
    font-size: 1.6rem;
    color: var(--bs-primary, #4361ee);
    line-height: 1;
}

.visual-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

.visual-card p {
    font-size: 0.73rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.3;
}

/* ── State grid — flex so last row centres ───────────────────── */
.state-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.state-card {
    flex: 0 0 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.25rem;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.state-card:hover {
    border-color: var(--bs-primary, #4361ee);
    background: #f8f9ff;
    color: var(--bs-primary, #4361ee);
    transform: translateY(-1px);
}

.state-card:active {
    transform: translateY(0);
}

/* ── "Outro" text input section ──────────────────────────────── */
.onboarding-other-section {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

/* ── Text input (Outro + Name) ───────────────────────────────── */
.onboarding-text-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    font-size: 0.95rem;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.onboarding-text-input:focus {
    border-color: var(--bs-primary, #4361ee);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.onboarding-text-input::placeholder {
    color: #9ca3af;
}

/* ── Name fields side-by-side ────────────────────────────────── */
.onboarding-name-fields {
    display: flex;
    gap: 0.75rem;
    animation: fadeInDown 0.2s ease-out;
}

/* ── Date selects ────────────────────────────────────────────── */
.onboarding-date-fields {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    animation: fadeInDown 0.2s ease-out;
}

/* Native <select> via dbc.Select — single arrow from Bootstrap */
.onboarding-date-select {
    border-radius: 10px !important;
    border: 2px solid #e5e7eb !important;
    font-size: 0.92rem !important;
    color: #374151 !important;
    background-color: #fff !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    cursor: pointer;
    /* Do NOT set appearance: auto — Bootstrap's .form-select already
       sets appearance:none + adds its own custom arrow via background-image.
       Overriding with auto would produce two arrows. */
}

.onboarding-date-select:focus {
    border-color: var(--bs-primary, #4361ee) !important;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1) !important;
    outline: none !important;
}

/* Widths — generous enough so placeholder text is never clipped */
.onboarding-date-select--day   { width: 100px; flex: 0 0 100px; }
.onboarding-date-select--month { width: 155px; flex: 0 0 155px; }
.onboarding-date-select--year  { width: 115px; flex: 0 0 115px; }

/* ── Date error message ──────────────────────────────────────── */
.onboarding-error-msg {
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    min-height: 1.2em;
    animation: fadeInDown 0.15s ease-out;
}

/* ── Continue button ─────────────────────────────────────────── */
.onboarding-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: var(--bs-primary, #4361ee);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    animation: fadeInUp 0.2s ease-out;
}

.onboarding-continue-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.onboarding-continue-btn:active {
    transform: translateY(0);
    opacity: 1;
}

/* ── Admin /onboarding page placeholder ──────────────────────── */
#onboarding-page-admin {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    .onboarding-modal .modal-dialog {
        margin: 0.5rem;
    }

    .onboarding-page {
        padding: 1.5rem 1rem 2rem;
    }

    .header-text h1 {
        font-size: 1.2rem;
    }

    .grid-options {
        gap: 0.65rem;
    }

    .visual-card {
        flex: 0 0 120px;
        padding: 0.85rem 0.5rem;
    }

    .visual-card .fas {
        font-size: 1.3rem;
    }

    .onboarding-name-fields {
        flex-direction: column;
        gap: 0.5rem;
    }

    .onboarding-date-fields {
        gap: 0.5rem;
    }

    .onboarding-date-select--day   { flex: 1 1 auto; width: auto; }
    .onboarding-date-select--month { flex: 1 1 auto; width: auto; }
    .onboarding-date-select--year  { flex: 1 1 auto; width: auto; }

    .state-card {
        flex: 0 0 52px;
        gap: 0.4rem;
    }
}
