/* ============================================
   RSK Annual Expense Calculator - Styles
   Brand Colors:
   - Primary Dark: #001F35
   - Primary Medium: #0A3A5C
   - Accent Gold: #D39E6D
   - Light Gold: #FFBC7D
   ============================================ */

:root {
    --primary-dark: #001F35;
    --primary-medium: #0A3A5C;
    --accent-gold: #D39E6D;
    --light-gold: #FFBC7D;
    --white: #FFFFFF;
    --off-white: #F8F6F3;
    --light-gray: #E8E4DF;
    --medium-gray: #9A9590;
    --text-dark: #1A1A1A;
    --text-medium: #4A4A4A;
    --success: #2E7D4F;
    --error: #C0392B;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Header */
.header {
    background: var(--white);
    color: var(--primary-dark);
    padding: 30px;
    text-align: center;
    position: relative;
    border-bottom: 3px solid var(--accent-gold);
}

.lang-toggle {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.lang-btn {
    padding: 6px 14px;
    border: 2px solid var(--primary-dark);
    background: transparent;
    color: var(--primary-dark);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--primary-dark);
    color: var(--white);
}

.lang-btn:hover:not(.active) {
    background: rgba(0, 31, 53, 0.1);
}

/* RTL Support */
[dir="rtl"] .lang-toggle {
    right: auto;
    left: 20px;
}

[dir="rtl"] .form-section,
[dir="rtl"] .charts-section {
    text-align: right;
}

[dir="rtl"] .navigation {
    flex-direction: row-reverse;
}

[dir="rtl"] .option-button {
    text-align: right;
}

[dir="rtl"] .form-input {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .form-label {
    text-align: right;
}

[dir="rtl"] .category-section {
    border-left: none;
    border-right: 4px solid var(--accent-gold);
}

[dir="rtl"] .expense-panel.subcategory {
    border-left: none;
    border-right: 4px solid var(--accent-gold);
}

[dir="rtl"] .detailed-summary {
    border-left: none;
    border-right: 4px solid var(--accent-gold);
}

[dir="rtl"] .pro-tip {
    border-left: none;
    border-right: 4px solid var(--accent-gold);
}

[dir="rtl"] .charts-section {
    border-left: none;
    border-right: 1px solid var(--light-gray);
}

[dir="rtl"] .main-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .step-header {
    text-align: right;
}

[dir="rtl"] .step-title,
[dir="rtl"] .step-subtitle {
    text-align: right;
}

[dir="rtl"] .category-title {
    text-align: right;
}

[dir="rtl"] .subsection-title {
    text-align: right;
}

[dir="rtl"] .additional-income-entry {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-add {
    text-align: right;
}

[dir="rtl"] .email-section h3 {
    text-align: right;
}

[dir="rtl"] .savings-method {
    text-align: right;
}

[dir="rtl"] .savings-card > p {
    text-align: right;
}

[dir="rtl"] .pro-tip-label {
    text-align: right;
}

[dir="rtl"] .pro-tip p {
    text-align: right;
}

[dir="rtl"] .summary-title {
    text-align: right;
}

[dir="rtl"] .sidebar-summary p {
    direction: rtl;
}

[dir="rtl"] .other-income-box {
    text-align: right;
}

[dir="rtl"] .results-section {
    text-align: right;
}

[dir="rtl"] .detailed-summary h4,
[dir="rtl"] .detailed-summary p {
    text-align: right;
}

[dir="rtl"] .email-section {
    text-align: right;
}

[dir="rtl"] .email-status {
    text-align: right;
}

.header-logo {
    height: 55px;
    margin-bottom: 12px;
    object-fit: contain;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--primary-dark);
}

.header p {
    font-size: 15px;
    color: var(--text-medium);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Coaching CTA Box */
.coaching-cta-box {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 31, 53, 0.06), rgba(46, 125, 79, 0.08));
    border: 2px solid var(--accent);
    border-radius: 12px;
    margin-top: 24px;
    text-align: center;
}

.coaching-cta-box p {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
    line-height: 1.5;
}

.coaching-cta-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.coaching-btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

/* Confidentiality Notice */
.confidentiality-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 31, 53, 0.04), rgba(10, 58, 92, 0.06));
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    margin-top: 24px;
}

.notice-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.confidentiality-notice p {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0;
}

.confidentiality-notice strong {
    color: var(--primary-dark);
}

[dir="rtl"] .confidentiality-notice {
    flex-direction: row-reverse;
    text-align: right;
}

/* Main Content */
.main-content {
    display: flex;
    min-height: 600px;
}

.form-section {
    flex: 2;
    padding: 40px;
    overflow-y: auto;
    max-height: 85vh;
}

.charts-section {
    flex: 1;
    background: var(--off-white);
    padding: 30px;
    border-left: 1px solid var(--light-gray);
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
}

.progress-step {
    padding: 10px 20px;
    background: var(--light-gray);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 13px;
    color: var(--medium-gray);
    text-align: center;
    flex: 1;
}

.progress-step.active {
    background: var(--primary-dark);
    color: var(--white);
}

.progress-step:hover {
    background: var(--primary-medium);
    color: var(--white);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--light-gray);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--light-gold));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Steps */
.step {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.step.active {
    display: block;
}

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

.step-header {
    margin-bottom: 28px;
}

.step-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.step-subtitle {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.6;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    color: var(--text-dark);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(211, 158, 109, 0.15);
}

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

/* Option Buttons */
.option-buttons {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.option-button {
    padding: 18px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.5;
}

.option-button:hover {
    border-color: var(--accent-gold);
    background: rgba(211, 158, 109, 0.05);
}

.option-button.selected {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: var(--white);
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Income Panel - appears right under the selected option */
.income-panel {
    margin-top: -8px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--off-white);
    border-radius: 0 0 12px 12px;
    border: 2px solid var(--light-gray);
    border-top: none;
    animation: slideDown 0.3s ease;
}

/* Expense Panel - appears right under the selected option */
.expense-panel {
    margin-top: -8px;
    margin-bottom: 20px;
    padding: 20px;
    animation: slideDown 0.3s ease;
}

.expense-panel.subcategory {
    background: var(--off-white);
    border-radius: 0 0 12px 12px;
    border: 2px solid var(--light-gray);
    border-top: none;
    border-left: 4px solid var(--accent-gold);
}

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

/* Additional Income Section */
.additional-income-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--off-white);
    border-radius: 12px;
    border: 2px solid var(--accent-gold);
}

.subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 14px;
}

.additional-income-entry {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.additional-income-entry .form-group {
    flex: 1;
    margin-bottom: 0;
}

.additional-income-entry .form-label {
    font-size: 13px;
}

.btn-remove {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--error);
    color: var(--white);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.btn-remove:hover {
    background: #A93226;
    transform: scale(1.05);
}

.btn-add {
    background: none;
    border: 2px dashed var(--accent-gold);
    color: var(--accent-gold);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.btn-add:hover {
    background: rgba(211, 158, 109, 0.08);
    border-color: var(--light-gold);
}

/* Other Income Box */
.other-income-box {
    margin: 20px 0;
    padding: 20px;
    background: var(--off-white);
    border-radius: 12px;
    border: 2px solid var(--accent-gold);
}

/* Category Section */
.category-section {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--off-white);
    border-radius: 12px;
    border-left: 4px solid var(--accent-gold);
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 14px;
}

/* Total Display */
.total-display {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-medium));
    color: var(--white);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin: 24px 0;
}

.total-display h3 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
    opacity: 0.9;
}

.total-display .amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--light-gold);
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--light-gold));
    color: var(--primary-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(211, 158, 109, 0.35);
}

.btn-secondary {
    background: var(--medium-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--text-medium);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--light-gray);
}

/* Charts */
.chart-container {
    margin-bottom: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 200px;
    margin-bottom: 16px;
}

/* Summary Cards */
.summary-card {
    background: var(--white);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--light-gray);
    margin-bottom: 16px;
}

.sidebar-summary {
    background: var(--white);
}

.sidebar-summary p {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-medium);
    display: flex;
    justify-content: space-between;
}

.sidebar-summary span {
    font-weight: 600;
    color: var(--primary-dark);
}

.summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 8px;
}

.summary-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
}

/* Results Section */
.results-section {
    background: var(--off-white);
    padding: 28px;
    border-radius: 12px;
    margin-top: 20px;
}

.detailed-summary {
    background: rgba(211, 158, 109, 0.1);
    padding: 24px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 4px solid var(--accent-gold);
}

.detailed-summary h4 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 16px;
}

.detailed-summary p {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-medium);
    font-size: 14px;
}

/* Savings Options */
.savings-options {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.savings-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
}

.savings-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.savings-method {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.savings-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.savings-card > p {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.6;
}

.pro-tip {
    background: rgba(211, 158, 109, 0.1);
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
    margin-top: 14px;
}

.pro-tip-label {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
    font-size: 13px;
}

.pro-tip p {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.5;
}

/* Email Section */
.email-section {
    background: rgba(211, 158, 109, 0.08);
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}

.email-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 14px;
}

.email-status {
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

.email-status.success { color: var(--success); }
.email-status.error { color: var(--error); }

/* Footer */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 28px 24px;
    margin-top: 30px;
}

.footer-logo {
    height: 36px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.footer p {
    font-size: 13px;
    margin-bottom: 6px;
}

.footer a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer a:hover {
    color: var(--light-gold);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .main-content {
        flex-direction: column;
    }

    .form-section,
    .charts-section {
        padding: 20px;
        max-height: none;
    }

    .container {
        border-radius: 15px;
    }

    .progress-steps {
        flex-wrap: wrap;
        gap: 8px;
    }

    .progress-step {
        padding: 8px 14px;
        font-size: 12px;
    }

    .header h1 {
        font-size: 22px;
    }

    .step-title {
        font-size: 22px;
    }

    .additional-income-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-remove {
        width: 100%;
        height: 36px;
    }
}