/* ==========================================================================
   ONBOARDING COMPONENT STYLES
   "Boxed Schematic" Design System (Optimized for Cross-Page Compatibility)
   ========================================================================== */

.onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 36, 18, 0.9); /* Darkened veil for focus */
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto; /* Enable scroll on the veil for over-tall content */
    z-index: 3000;
}

.onboarding-modal.active {
    display: flex;
}

.onboarding-content {
    background-color: #f4ecd8 !important; /* Paper Beige base */
    background-image:
        linear-gradient(to right, rgba(59, 66, 42, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(59, 66, 42, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 3px solid #3b422a !important;
    box-shadow: 10px 10px 0 #3b422a !important;
    width: 100%;
    max-width: 800px; /* Standard wide modal for desktop */
    padding: 60px 35px 30px; /* Increased top padding to clear close button */
    position: relative;
    max-height: none; /* Let height be natural, parent handles scroll */
    flex-shrink: 0; /* Prevent shrinking when parent is flex */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-content.tight-modal {
    padding-top: 40px;
    padding-bottom: 20px;
}

.onboarding-content.tight-modal .onboarding-header,
.onboarding-content.tight-modal .onboarding-form,
.onboarding-content.tight-modal .onboarding-actions,
.onboarding-content.tight-modal .onboarding-options.single-col {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.onboarding-content.tight-modal .onboarding-header {
    margin-bottom: 20px;
}

.onboarding-content.tight-modal .onboarding-actions {
    margin-top: 15px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f4ecd8 !important;
    border: 3px solid #3b422a !important;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    color: #3b422a !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0 #3b422a !important;
    z-index: 3002;
    transition: all 0.1s;
}

.modal-close:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #3b422a !important;
    background: #8e2d2d !important; /* Danger Red */
    color: #f4ecd8 !important;
}

/* Onboarding Header */
.onboarding-header {
    text-align: center;
    margin-bottom: 35px;
}

.onboarding-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 950 !important;
    text-transform: uppercase;
    margin: 0 0 10px 0;
    color: #3b422a !important;
    letter-spacing: 1px;
    line-height: 1.2;
}

.onboarding-sub {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.75rem;
    color: #6b7a4f !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Steps & Transitions */
.onboarding-step {
    display: none;
    animation: step-fade 0.4s ease-out;
}

.onboarding-step.active {
    display: block;
}

@keyframes step-fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Selections: Card Layout */
.onboarding-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 20px;
}

.onboarding-options.single-col {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.option-card {
    background: white !important;
    border: 3px solid #3b422a !important;
    padding: 35px 30px 30px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 6px 6px 0 #3b422a !important;
}

.option-card h3 {
    font-size: 1.1rem;
    font-weight: 900;
    color: #3b422a !important;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.inline-icon {
    width: 24px;
    height: 24px;
    fill: #3b422a !important;
    flex-shrink: 0;
}

.warning-tip {
    background: rgba(255, 245, 157, 0.4) !important;
    border: 3px solid #3b422a !important;
    padding: 15px 25px;
    margin: 30px auto 0;
    max-width: 620px;
    display: flex;
    align-items: flex-start; /* Better for multi-line text */
    justify-content: flex-start;
    color: #3b422a !important;
    font-size: 0.95rem;
    box-shadow: 4px 4px 0 rgba(59, 66, 42, 0.1);
    line-height: 1.5;
}

.warning-tip span {
    text-align: left;
    display: block;
}

.tip-svg {
    width: 20px;
    height: 20px;
    fill: #3b422a !important;
    margin-right: 15px;
    margin-top: 2px; /* Align with first line of text */
    flex-shrink: 0;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 9px 9px 0 #6b7a4f !important;
    background: #fffcf5 !important;
}

.option-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-icon svg {
    width: 40px;
    height: 40px;
    fill: #3b422a !important;
}

.option-badge {
    position: absolute !important;
    top: -16px !important; 
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: #3b422a !important;
    background: #3b422a !important;
    color: #f4ecd8 !important; /* Paper Beige */
    font-size: 0.75rem !important;
    padding: 6px 16px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2) !important;
    z-index: 99 !important;
    white-space: nowrap !important;
    border: 2px solid #3b422a !important;
    line-height: 1 !important;
    display: block !important;
}

.option-card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 950;
    margin-bottom: 10px;
    color: #3b422a !important;
    text-transform: uppercase;
    line-height: 1.3;
}

.option-card h3 svg {
    color: #3b422a !important;
}

.option-card p {
    font-size: 0.9rem;
    color: rgba(59, 66, 42, 0.7) !important;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
}

/* Grid Cards (Incomes) */
.step-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.grid-card {
    border: 3px solid #3b422a !important;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    background: white !important;
    box-shadow: 3px 3px 0 #3b422a !important;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.grid-card.selected {
    background: #3b422a !important;
    color: #f4ecd8 !important;
    transform: translate(2px, 2px);
    box-shadow: none !important;
}

.grid-card:hover:not(.selected) {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #3b422a !important;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: inherit;
}

.grid-card span {
    font-weight: 850;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Calibration Area */
/* Calibration Area */
.calibration-animation {
    padding: 30px 0;
    text-align: center;
}

.cal-bar-container {
    width: 100%;
    height: 20px;
    border: 3px solid #3b422a !important;
    background: rgba(59, 66, 42, 0.1);
    position: relative;
    margin-bottom: 20px;
}

.cal-bar-fill {
    width: 0%;
    height: 100%;
    background: #3b422a !important;
    transition: width 0.4s ease-out;
}

.cal-logs {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #3b422a !important;
    height: 20px;
    overflow: hidden;
}

/* System Summary Strip Styling */
.summary-strip {
    background: #f4ecd8 !important;
    border: 3px solid #3b422a !important;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 8px 8px 0 rgba(59, 66, 42, 0.15);
}

.summary-header {
    background: #3b422a !important;
    padding: 15px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ready-badge {
    background: #6b7a4f !important;
    color: #f4ecd8 !important;
    padding: 4px 8px;
    font-size: 0.65rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(244, 236, 216, 0.3);
}

.summary-title {
    color: #f4ecd8 !important;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.summary-items {
    padding: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(59, 66, 42, 0.1);
}

.summary-item:last-child {
    border-bottom: none;
}

.item-check {
    color: #6b7a4f !important;
    font-size: 1.2rem;
    font-weight: 900;
}

.item-text {
    font-size: 0.95rem;
    color: #3b422a !important;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* Footer & Progress */
.roadmap-mini {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.step-dot {
    width: 10px;
    height: 10px;
    border: 2px solid #3b422a !important;
    background: transparent;
    border-radius: 50%;
}

.step-dot.active {
    background: #3b422a !important;
}

/* Action Layout & Buttons */
.onboarding-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.onboarding-next-btn {
    flex: 2; /* Primary action is wider */
    background-color: #3b422a !important;
    background: #3b422a !important;
    color: #f4ecd8 !important;
    border: 3px solid #3b422a !important;
    padding: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 950;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 6px 6px 0 #6b7a4f !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block !important;
}

.onboarding-back-btn {
    flex: 1; /* Secondary action */
    background-color: #f4ecd8 !important;
    background: #f4ecd8 !important;
    color: #3b422a !important;
    border: 3px solid #3b422a !important;
    padding: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 950;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0 #3b422a !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block !important;
}

.onboarding-next-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 #6b7a4f !important;
    background-color: #4a5435 !important;
}

.onboarding-back-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #3b422a !important;
    background-color: #faf7f0 !important;
}

.onboarding-footer {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(59, 66, 42, 0.7) !important;
    margin-top: 30px;
    border-top: 1px solid #3b422a !important;
    padding-top: 20px;
}

@media (max-width: 600px) {
    .summary-strip h2 {
        font-size: 1.4rem !important;
        padding: 10px 15px !important;
        margin-top: -35px !important;
    }

    .summary-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .summary-item {
        padding: 10px !important;
    }

    .status-badge {
        font-size: 0.75rem !important;
    }

    .warning-tip {
        padding: 12px 15px !important;
        margin: 20px 10px 0 !important;
        font-size: 0.85rem !important;
    }

    .tip-svg {
        width: 18px !important;
        height: 18px !important;
        margin-right: 10px !important;
    }

    .onboarding-actions {
        flex-direction: column-reverse; /* Stack buttons on mobile */
        gap: 10px;
    }

    .onboarding-back-btn, .onboarding-next-btn {
        width: 100% !important;
        flex: none !important;
        padding: 12px !important;
        font-size: 0.9rem !important;
    }
    
    .centered-btn {
        width: 100% !important;
    }

    .onboarding-content.tight-modal {
        padding-top: 35px;
        padding-bottom: 15px;
    }

    /* ATL Mobile Optimization */
    .atl-input-group {
        flex-direction: column;
        gap: 15px;
    }

    .atl-check-btn {
        width: 100%;
        height: 55px;
        box-shadow: 5px 5px 0 #6b7a4f !important;
        font-size: 1rem !important;
    }

    .atl-input-group input {
        width: 100%;
        padding: 16px !important;
        font-size: 1.25rem !important;
        text-align: center;
    }

    .status-badge {
        width: 100%;
        justify-content: center;
        font-size: 0.85rem !important;
        padding: 15px !important;
    }
}

/* Response Styles */
@media (max-width: 800px) {
    .onboarding-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .onboarding-content {
        width: 96%;
        padding: 50px 15px 20px;
        margin: 5px;
        box-shadow: 6px 6px 0 #3b422a !important; /* Slightly smaller shadow for mobile */
    }

    .onboarding-content.tight-modal .onboarding-header,
    .onboarding-content.tight-modal .onboarding-form,
    .onboarding-content.tight-modal .onboarding-actions,
    .onboarding-content.tight-modal .onboarding-options.single-col {
        max-width: 100% !important;
    }
    
    .onboarding-header h2 {
        font-size: 1.25rem;
        padding: 0 40px; /* Leave room for close button */
        line-height: 1.2;
    }
    
    .modal-close {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
        top: 8px;
        right: 8px;
    }
    
    .onboarding-sub {
        font-size: 0.65rem;
        padding: 0 20px;
    }
    
    .option-card {
        padding: 20px 15px;
        box-shadow: 4px 4px 0 #3b422a !important;
    }

    /* Mobile Scrolling Fixes */
    .onboarding-modal {
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Ensure scrolling starts from top */
        padding: 40px 0;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .onboarding-content {
        margin: 0 auto;
        flex-shrink: 0; /* Important for long content in flex containers */
    }
}
/* Legal Agreements Style (Boxed Schematic) */
.legal-agreements {
    max-width: 480px;
    margin: 30px auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #3b422a !important;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    text-align: left;
}

.legal-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 3px solid #3b422a !important;
    background: white !important;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
    box-shadow: 2px 2px 0 #3b422a !important;
    transition: all 0.1s;
}

.legal-checkbox-label input[type="checkbox"]:checked {
    background: #6b7a4f !important;
    box-shadow: none !important;
    transform: translate(1px, 1px);
}

.legal-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #f4ecd8 !important;
    font-size: 14px;
    font-weight: 900;
}

.legal-checkbox-label a {
    color: #3b422a !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.2s;
}

/* Summary Strip Refinements */
.summary-strip {
    background: #f4ecd8 !important;
    border: 3px solid #3b422a !important;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 8px 8px 0 rgba(59, 66, 42, 0.15);
}

.persona-profile-box {
    background: rgba(59, 66, 42, 0.1) !important;
    padding: 15px !important;
    border-radius: 4px;
    margin-top: 15px;
    display: flex;
    flex-direction: column !important;
    align-items: flex-start !important;
}

.persona-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
    color: #3b422a;
    opacity: 0.7;
    margin-bottom: 8px;
}

.persona-tags-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.persona-tags-strip span {
    background: #3b422a;
    color: #f4ecd8;
    padding: 4px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 2px;
}

@media (max-width: 600px) {
    .persona-tags-strip {
        flex-direction: column;
        gap: 6px;
    }
    
    .persona-tags-strip span {
        width: 100%;
        text-align: center;
        font-size: 0.75rem;
    }
}

/* Button Disabled State (Boxed Schematic) */
.onboarding-next-btn:disabled {
    background-color: #aeb59c !important;
    border-color: #3b422a !important;
    color: rgba(59, 66, 42, 0.5) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Persona Discovery Form Styling */
.onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.onboarding-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.onboarding-form label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #3b422a;
    padding-left: 5px;
}

.onboarding-form select {
    width: 100%;
    padding: 12px 15px;
    background: white !important;
    border: 3px solid #3b422a !important;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #3b422a !important;
    box-shadow: 4px 4px 0 #3b422a !important;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233b422a' stroke-width='3' stroke-linecap='square' stroke-linejoin='arcs'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    transition: all 0.1s;
}

.onboarding-form select:focus {
    outline: none;
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 #6b7a4f !important;
}

/* Utility: Full-Width Navigation Button */
.centered-btn {
    flex: 1 !important;
    width: 100%;
}

/* ==========================================================================
   ATL STATUS CHECK MODULE (STEP 1.5)
   ========================================================================== */

.atl-check-container {
    text-align: left;
}

.atl-input-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.atl-input-group input {
    flex: 1;
    background: white !important;
    border: 3px solid #3b422a !important;
    padding: 14px 18px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 1.1rem;
    color: #3b422a !important;
    box-shadow: 4px 4px 0 #3b422a !important;
    transition: all 0.1s;
}

.atl-input-group input:focus {
    outline: none;
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 #6b7a4f !important;
}

.atl-check-btn {
    background: #3b422a !important;
    color: #f4ecd8 !important;
    border: 3px solid #3b422a !important;
    padding: 0 25px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 950;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0 #6b7a4f !important;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atl-check-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 #6b7a4f !important;
    background: #4a5435 !important;
}

.atl-check-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.atl-status-area {
    margin-top: 20px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-badge {
    padding: 10px 20px;
    border: 3px solid #3b422a !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: status-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 6px 6px 0 rgba(59, 66, 42, 0.15);
}

@keyframes status-pop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.status-badge.active-status {
    background: #6b7a4f !important;
    color: #f4ecd8 !important;
}

.status-badge.non-filer-status {
    background: #c2991a !important; /* Amber */
    color: #3b422a !important;
}

.status-badge.error-status {
    background: #8e2d2d !important;
    color: #f4ecd8 !important;
}

.onboarding-skip-link:hover {
    color: #8e2d2d !important;
}
