:root {
    --bg-primary: #0d1838;
    --text-color: #ffffff;
    --accent-color: #4ba3d4;
}

#fp-app {
    padding: 100px 5% 60px;
    min-height: 80vh;
    background: var(--bg-primary);
    color: var(--text-color);
    position: relative;
    font-family: 'Inter', sans-serif;
}

.fp-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

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

/* ================================
   STEP 1: LEAD CAPTURE MODAL
================================ */
.fp-lead-box {
    position: relative;
    z-index: 100;
    pointer-events: auto;
    max-width: 500px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.fp-lead-box h2 {
    font-family: 'Playfair Display', serif;
    color: var(--text-color);
    font-size: 28px;
    margin-bottom: 12px;
}

.fp-lead-box p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.6;
}

.fp-input-group {
    text-align: left;
    margin-bottom: 20px;
}

.fp-input-group label {
    display: block;
    color: #fff;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.fp-input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.fp-btn-primary {
    width: 100%;
    padding: 16px;
    background: #4ba3d4;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.fp-btn-primary:hover {
    background: #3a8ab0;
}

.fp-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
}

/* ================================
   STEP 2: PLANNER APP UI
================================ */
.fp-header {
    text-align: center;
}
.fp-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
}

.fp-planner-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.fp-inputs-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.fp-inputs-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
}

.fp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.fp-form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-bottom: 6px;
}

.fp-form-group input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
}

/* Dynamic Events */
.ev-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    align-items: flex-end;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s;
}

.ev-grid:hover {
    background: rgba(255, 255, 255, 0.07);
}

.ev-grid > div {
    flex: 1 1 120px;
    min-width: 0;
}

.ev-grid .ev-details-col {
    flex: 2 1 240px;
}

.ev-grid .ev-action-col {
    flex: 0 0 auto;
    width: 40px;
    display: flex;
    justify-content: center;
}

.ev-grid .loan-fields {
    flex: 1 1 120px;
}

.ev-grid .recurring-fields {
    flex: 1 1 120px;
}

@media (max-width: 768px) {
    .ev-grid {
        gap: 12px;
        padding: 16px;
    }
    .ev-grid > div {
        flex: 1 1 calc(50% - 12px);
    }
    .ev-grid .ev-details-col {
        flex: 1 1 100%;
        order: -1; /* Keep details at top maybe? */
    }
    .ev-grid .ev-action-col {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .ev-grid > div {
        flex: 1 1 100%;
    }
}

.ev-grid label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ev-grid input, .ev-grid select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
}

.ev-grid select option {
    background: var(--bg-primary);
    color: #fff;
}

/* ================================
   REPORT VIEW
================================ */
.fp-report-hidden {
    display: none;
}

.fp-report-sheet {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    color: #1a2d5a;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.fp-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.fp-report-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.fp-summary-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fp-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 4px;
}

.fp-sum-row span {
    color: #475569;
}

.fp-sum-row strong {
    color: #2b7a78;
}

.fp-table-wrapper {
    overflow-x: auto;
}

.fp-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fp-data-table th, .fp-data-table td {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    text-align: right;
    white-space: nowrap;
}

.fp-data-table th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    text-align: center;
}

.fp-data-table td:nth-child(2),
.fp-data-table td:nth-child(3),
.fp-data-table td:nth-child(4) {
    text-align: center;
}

.fp-data-table tr.negative td {
    background-color: #fef2f2;
}

@media (max-width: 900px) {
    .fp-report-summary-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .ev-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media(max-width: 600px) {
    #fp-app { padding: 80px 5% 40px; }
    .fp-header h1 { font-size: 28px; }
    .fp-report-sheet { padding: 20px; }
}

@media (max-width: 480px) {
    .ev-grid {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }
    .ev-grid > div {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    .ev-grid .ev-details-col {
        flex: 1 1 100% !important;
    }
    .ev-grid .ev-action-col {
        width: 100% !important;
        justify-content: flex-end;
    }
    .ev-grid input,
    .ev-grid select {
        font-size: 15px;
        padding: 12px 14px;
    }
    .ev-grid label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .fp-form-group input,
    .fp-form-group select {
        font-size: 16px;
        padding: 12px 14px;
    }
}
