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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #231F20;
    min-height: 100vh;
    position: relative;
    padding-bottom: 40px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Logo */
.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}
.company-logo {
    max-height: 80px;
    max-width: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}
header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content card */
.main-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

/* Disclaimer */
.disclaimer-section {
    padding: 20px 30px;
    background: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
    border-top: 3px solid #f39c12;
}
.disclaimer-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #856404;
}
.disclaimer-content strong {
    color: #b7791f;
    font-weight: 600;
}

/* Input sections */
.input-section {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}
.input-section h2 {
    color: #231F20;
    margin-bottom: 25px;
    font-size: 1.8rem;
}
.optional-tag {
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
}

/* Input grid (income) */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}
.input-group {
    display: flex;
    flex-direction: column;
}
.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}
.input-group input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.field-note {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.5;
    margin-top: 5px;
}

/* Category blocks */
.category-block {
    margin-bottom: 30px;
}
.category-block h3 {
    color: #231F20;
    font-size: 1.3rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.category-block h4 {
    color: #495057;
    font-size: 1.05rem;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Field rows */
.field-header-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.field-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 6px 0;
}
.field-row label {
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.field-row input {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
}
.field-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.notes-input {
    color: #666;
}

/* Tooltips */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
}
.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 400;
    width: 280px;
    line-height: 1.5;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}
.tooltip-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    z-index: 101;
}

/* Add row buttons */
.add-row-btn {
    background: none;
    border: 2px dashed #ccc;
    color: #667eea;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}
.add-row-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

/* Total bars */
.total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #231F20, #3a3536);
    color: white;
    padding: 18px 30px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 10px;
    margin-top: 20px;
}
.total-bar.liability {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

/* Action section */
.action-section {
    padding: 30px;
    text-align: center;
}

/* Buttons */
.calculate-btn {
    background: #231F20;
    color: white;
    border: none;
    padding: 16px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(35,31,32,0.3);
}
.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35,31,32,0.4);
}

/* ===== PAGE 2 — RESULTS ===== */

/* Classification banner */
.classification-banner {
    text-align: center;
    padding: 35px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid #231F20;
}
.classification-lead {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 8px;
}
.classification-banner h2 {
    font-size: 2.2rem;
    color: #231F20;
}
.classification-banner.accredited h2 { color: #28a745; }
.classification-banner.qualified-client h2 { color: #1976d2; }
.classification-banner.qualified-purchaser h2 { color: #6f42c1; }
.classification-banner.sub-accredited h2 { color: #6c757d; }

/* Charts dashboard */
.charts-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 30px;
}
.chart-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.chart-card h3 {
    color: #231F20;
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.chart-card canvas {
    max-height: 300px;
    width: 100% !important;
}

/* Carousel dots (mobile only) */
.carousel-dots {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 30px 20px;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s;
}
.dot.active { background: #231F20; }
.carousel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #231F20;
    background: white;
    color: #231F20;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.carousel-arrow:hover {
    background: #231F20;
    color: white;
}

/* Summary cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 0 30px 30px;
}
.summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 22px;
    border-radius: 12px;
    border-left: 5px solid #231F20;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.summary-card h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.summary-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Results actions */
.results-actions {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    border-top: 1px solid #e9ecef;
}
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
}
.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.4);
}
.consent-row {
    max-width: 600px;
    text-align: left;
}
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    line-height: 1.5;
}
.consent-label input[type="checkbox"] {
    margin-top: 4px;
    transform: scale(1.2);
    accent-color: #667eea;
    flex-shrink: 0;
}
.book-btn {
    display: inline-flex;
    align-items: center;
    background: #231F20;
    color: white;
    border: none;
    padding: 14px 30px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(35,31,32,0.3);
}
.book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35,31,32,0.4);
    color: white;
}
.back-btn {
    background: none;
    border: 2px solid #231F20;
    color: #231F20;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.back-btn:hover {
    background: #231F20;
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .field-header-row,
    .field-row {
        grid-template-columns: 160px 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .container { padding: 10px; }
    .logo-container { top: 10px; left: 10px; }
    .company-logo { max-height: 50px; max-width: 120px; }
    header h1 { font-size: 1.8rem; }
    .input-section { padding: 20px 15px; }

    .field-header-row {
        display: none;
    }
    .field-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .field-row label {
        font-weight: 600;
        font-size: 0.85rem;
    }
    .input-grid {
        grid-template-columns: 1fr;
    }
    .total-bar {
        font-size: 1.1rem;
        padding: 14px 18px;
    }

    /* Carousel mode for charts */
    .charts-dashboard {
        display: flex;
        overflow-x: hidden;
        scroll-snap-type: x mandatory;
        gap: 0;
        padding: 20px 15px;
    }
    .chart-card {
        min-width: 100%;
        scroll-snap-align: start;
        flex-shrink: 0;
        display: none;
    }
    .chart-card.carousel-active {
        display: block;
    }
    .carousel-dots {
        display: flex;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        padding: 0 15px 20px;
    }
    .results-actions {
        padding: 20px 15px;
    }
    .classification-banner h2 {
        font-size: 1.6rem;
    }
}

/* Soft Gate Modal */
.soft-gate-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.soft-gate-modal {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.soft-gate-modal h2 {
    font-size: 1.3rem;
    color: #231F20;
    margin-bottom: 8px;
}
.soft-gate-modal p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}
.soft-gate-field {
    margin-bottom: 14px;
}
.soft-gate-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #231F20;
    margin-bottom: 4px;
}
.soft-gate-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}
.soft-gate-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.soft-gate-buttons .calculate-btn,
.soft-gate-buttons .back-btn {
    flex: 1;
    font-size: 0.95rem;
    padding: 12px;
}
