* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --charcoal: #1a1a2e;
    --deep: #16213e;
    --amber: #e8a838;
    --amber-light: #f5c563;
    --cream: #faf8f4;
    --warm-gray: #b8b0a4;
    --text: #2d2d3a;
    --text-light: #6b6b7b;
    --coral: #e07c5a;
    --green: #4caf7d;
    --red: #e05a5a;
    --card-bg: #ffffff;
    --card-border: rgba(0,0,0,0.06);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--cream);
    overflow-x: hidden;
    line-height: 1.6;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    background: rgba(250, 248, 244, 0.85);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--charcoal);
    letter-spacing: -0.02em;
    cursor: pointer;
}

.logo span { color: var(--amber); }

.nav-tag {
    font-size: 0.8rem;
    color: var(--text-light);
    background: rgba(232, 168, 56, 0.12);
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-weight: 500;
}

/* HERO */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 4rem 4rem;
    gap: 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(232, 168, 56, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 620px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--coral);
    background: rgba(224, 124, 90, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--charcoal);
    margin-bottom: 1.5rem;
}

.hero h1 .accent {
    color: var(--amber);
    position: relative;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 520px;
}

.hero-note {
    font-size: 0.85rem;
    color: var(--warm-gray);
    margin-top: 1rem;
}

.hero-visual {
    flex: 0.8;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
}

.visual-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.visual-card:hover { transform: translateY(-2px); }

.card-1 { transform: rotate(-1deg); }
.card-2 { transform: rotate(0.5deg) translateX(20px); }
.card-3 { transform: rotate(-0.3deg) translateX(-10px); }

.card-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.card-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--charcoal);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-tag {
    font-size: 0.7rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    background: rgba(76, 175, 125, 0.1);
    color: var(--green);
}

.card-tag.up { background: rgba(76, 175, 125, 0.1); color: var(--green); }

.card-bar {
    margin-top: 0.75rem;
    height: 6px;
    background: rgba(0,0,0,0.04);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--charcoal);
    border-radius: 3px;
    transition: width 1.5s ease;
}

.bar-fill.golden { background: var(--amber); }

.card-mini {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 500;
}

/* BUTTONS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--charcoal);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--deep);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-light);
    border: 1.5px dashed rgba(0,0,0,0.15);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.btn-secondary:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    padding: 0.75rem 1rem;
    transition: color 0.2s;
}

.btn-back:hover { color: var(--text); }

/* SECTIONS */
.section {
    padding: 5rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
}

/* HOW IT WORKS */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step {
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: transform 0.2s ease;
}

.step:hover { transform: translateY(-4px); }

.step-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--amber);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.step h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
}

.step p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* QUESTIONNAIRE */
.q-container {
    max-width: 700px;
    margin: 0 auto;
    padding-top: 2rem;
}

.q-progress {
    height: 4px;
    background: rgba(0,0,0,0.06);
    border-radius: 2px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.q-progress-bar {
    height: 100%;
    background: var(--amber);
    border-radius: 2px;
    width: 20%;
    transition: width 0.4s ease;
}

.q-step-label {
    font-size: 0.8rem;
    color: var(--warm-gray);
    font-weight: 500;
    margin-bottom: 2.5rem;
}

.q-step h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.q-desc {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* INPUTS */
.input {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.1);
}

.input::placeholder { color: var(--warm-gray); }

.input-full { width: 100%; }
.input-sm { max-width: 180px; }

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

/* INCOME/EXPENSE/GOAL ROWS */
.income-row, .expense-row, .goal-row {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: start;
}

.income-row {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}

.income-row.has-delete {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 40px;
}

.expense-row {
    grid-template-columns: 2fr 1fr 1.5fr;
}

.expense-row.has-delete {
    grid-template-columns: 2fr 1fr 1.5fr 40px;
}

.goal-row {
    grid-template-columns: 2fr 0.8fr 1fr 1fr;
}

.goal-row.has-delete {
    grid-template-columns: 2fr 0.8fr 1fr 1fr 40px;
}

/* DELETE BUTTON */
.btn-delete {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    margin-top: 2px;
}

.btn-delete:hover {
    background: rgba(224, 90, 90, 0.08);
    color: var(--red);
}

.btn-delete:active {
    transform: scale(0.95);
}

/* RISK OPTIONS */
.risk-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.risk-option {
    position: relative;
    cursor: pointer;
}

.risk-option input { position: absolute; opacity: 0; }

.risk-label {
    display: block;
    text-align: center;
    padding: 1.25rem 1rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
    background: var(--card-bg);
}

.risk-label small {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.risk-option input:checked + .risk-label {
    border-color: var(--amber);
    background: rgba(232, 168, 56, 0.06);
    color: var(--charcoal);
}

/* TOGGLE */
.toggle-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.toggle-btn {
    padding: 0.7rem 1.5rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    background: var(--card-bg);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    border-color: var(--amber);
    background: rgba(232, 168, 56, 0.06);
    color: var(--charcoal);
    font-weight: 600;
}

/* Q NAV */
.q-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* LOADING */
.loading-container {
    text-align: center;
    padding: 8rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0,0,0,0.06);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 2rem;
}

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

.loading-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
}

.loading-sub {
    color: var(--text-light);
    font-size: 1rem;
}

/* PLAN RESULTS */
.plan-container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 4rem;
}

.plan-header {
    margin-bottom: 3rem;
}

.plan-badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--amber);
    background: rgba(232, 168, 56, 0.1);
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.plan-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.plan-summary-detail {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.6;
    font-weight: 400;
}

.plan-summary-detail strong {
    color: var(--charcoal);
    font-weight: 700;
}

/* PLAN CARDS */
.plan-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.25rem;
    transition: transform 0.2s ease;
}

.plan-card:hover { transform: translateY(-2px); }

.plan-card .card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.plan-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 1rem;
}

.plan-card p, .plan-card li {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
}

.plan-card ul {
    list-style: none;
    padding: 0;
}

.plan-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.plan-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--amber);
}

/* SNAPSHOT */
.snapshot-card {
    background: var(--charcoal);
    border: none;
}

.snapshot-card h3 { color: white; }

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.snapshot-item {
    text-align: center;
}

.snapshot-label {
    font-size: 0.75rem;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.snapshot-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
}

.snapshot-value.positive { color: var(--green); }
.snapshot-value.negative { color: var(--coral); }

/* SMOOTHING HIGHLIGHT */
.smoothing-highlight {
    background: rgba(232, 168, 56, 0.06);
    border: 1px solid rgba(232, 168, 56, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.smoothing-highlight .label {
    font-size: 0.8rem;
    color: var(--amber);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.smoothing-highlight .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--charcoal);
}

/* ACTION ITEMS */
.action-card { border-left: 3px solid var(--amber); }

.action-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    align-items: flex-start;
}

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

.action-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--amber);
    background: rgba(232, 168, 56, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-text {
    flex: 1;
}

.action-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.action-text span {
    font-size: 0.8rem;
    color: var(--warm-gray);
}

/* RISK */
.risk-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.risk-badge.low { background: rgba(76, 175, 125, 0.1); color: var(--green); }
.risk-badge.medium { background: rgba(232, 168, 56, 0.1); color: var(--amber); }
.risk-badge.high { background: rgba(224, 90, 90, 0.1); color: var(--red); }

/* GOAL ALLOCATION */
.goal-alloc {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.goal-alloc:last-child { border-bottom: none; }

.goal-alloc-name {
    font-weight: 500;
    color: var(--text);
}

.goal-alloc-amount {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--charcoal);
}

.goal-alloc-time {
    font-size: 0.8rem;
    color: var(--warm-gray);
}

/* PLAN FOOTER */
.plan-footer {
    text-align: center;
    padding: 3rem 0 2rem;
}

.plan-note {
    font-size: 0.8rem;
    color: var(--warm-gray);
    margin-top: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* FOOTER */
footer {
    padding: 3rem 4rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-content .logo { margin-bottom: 0.5rem; }

.footer-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-small {
    font-size: 0.8rem !important;
    color: var(--warm-gray) !important;
    margin-top: 0.5rem;
}

/* RESUME MODAL */
.resume-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.resume-modal-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.15);
    animation: slideUp 0.3s ease;
}

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

.resume-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.resume-modal-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.resume-modal-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.75rem;
}

.resume-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resume-actions .btn-primary {
    width: 100%;
    justify-content: center;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-light);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text);
}

/* SAVE & EXIT */
.btn-save-exit {
    background: none;
    border: 1.5px solid rgba(0,0,0,0.1);
    color: var(--text-light);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-exit:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.q-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* SAVE TOAST */
.save-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--charcoal);
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 300;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.save-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        padding: 7rem 2rem 3rem;
        text-align: center;
    }

    .hero h1 { font-size: 2.6rem; }
    .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-visual { display: none; }

    .steps-grid { grid-template-columns: 1fr; }

    .section { padding: 3rem 1.5rem; }

    .income-row { grid-template-columns: 1fr 1fr; }
    .expense-row { grid-template-columns: 1fr 1fr; }
    .goal-row { grid-template-columns: 1fr 1fr; }

    .snapshot-grid { grid-template-columns: repeat(2, 1fr); }

    .risk-options { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }

    .income-row,
    .expense-row,
    .goal-row { grid-template-columns: 1fr; }

    .snapshot-grid { grid-template-columns: 1fr 1fr; }

    nav { padding: 1rem 1.25rem; }
    .logo { font-size: 1.3rem; }
    .nav-tag { font-size: 0.7rem; }
}
