/* DPC Calculator Styles */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0f4c81;
    --primary-light: #1a6bb8;
    --primary-dark: #0a3a5f;
    --accent: #d4af37;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #1a2332;
    --text-medium: #4a5568;
    --text-light: #718096;
    --bg-cream: #fdfbf7;
    --bg-light: #f7f9fc;
    --bg-white: #ffffff;
    --border-subtle: #e8eff7;
    --border-medium: #cbd5e0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
    background: var(--bg-cream);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Calculator Container */
.calculator-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.calculator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.calculator-title {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.calculator-subtitle {
    font-size: 1.125rem;
    color: var(--text-medium);
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

.calculator-card-title {
    font-family: 'Crimson Pro', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.calculator-card-description {
    color: var(--text-medium);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.form-grid-full {
    grid-column: 1 / -1;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label-optional {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-help {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Input Styles */
.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    border: 2px solid var(--border-medium);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

/* Input with Icon/Prefix */
.input-wrapper {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-medium);
    font-weight: 600;
    pointer-events: none;
}

.form-input.has-prefix {
    padding-left: 2.5rem;
}

/* Checkbox and Radio */
.form-checkbox-group,
.form-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-item:hover,
.radio-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-light);
}

.checkbox-item input[type="checkbox"],
.radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label,
.radio-label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-medium);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Range Slider */
.range-slider {
    width: 100%;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--border-subtle);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    border: none;
}

.range-value {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Results Section */
.results-container {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    padding: 3rem;
    color: white;
    margin-top: 2rem;
    box-shadow: var(--shadow-xl);
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-title {
    font-family: 'Crimson Pro', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.results-subtitle {
    opacity: 0.9;
    font-size: 1.125rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.result-value {
    font-family: 'Crimson Pro', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.result-description {
    margin-top: 0.75rem;
    opacity: 0.85;
    font-size: 0.95rem;
}

/* Savings Highlight */
.savings-highlight {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.savings-amount {
    font-family: 'Crimson Pro', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.savings-label {
    font-size: 1.25rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Info Boxes */
.info-box {
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.info-box-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.info-box-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.info-box-content {
    color: var(--text-medium);
    line-height: 1.6;
}

.info-box.warning {
    background: #fef3c7;
    border-left-color: var(--warning);
}

.info-box.warning .info-box-title {
    color: var(--warning);
}

.info-box.success {
    background: #d1fae5;
    border-left-color: var(--success);
}

.info-box.success .info-box-title {
    color: var(--success);
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.comparison-table thead {
    background: var(--primary);
    color: white;
}

.comparison-table th {
    padding: 1.25rem;
    text-align: left;
    font-weight: 700;
    font-size: 1rem;
}

.comparison-table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background: var(--bg-light);
}

.table-value-positive {
    color: var(--success);
    font-weight: 700;
}

.table-value-negative {
    color: var(--danger);
    font-weight: 700;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-subtle);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-message {
    background: #fee2e2;
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 1rem;
    color: var(--danger);
    margin: 1rem 0;
}

.form-input.error {
    border-color: var(--danger);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--text-light);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

.tooltip:hover .tooltip-icon {
    background: var(--primary);
}

/* Progress Indicator */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-subtle);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

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

.progress-step.completed .progress-step-circle {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.progress-step-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
}

.progress-step.active .progress-step-label {
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-card {
        padding: 2rem 1.5rem;
    }

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

    .results-container {
        padding: 2rem 1.5rem;
    }

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

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .comparison-table {
        font-size: 0.875rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .btn,
    .form-group,
    .progress-steps {
        display: none;
    }

    .results-container {
        background: white;
        color: var(--text-dark);
        box-shadow: none;
    }

    .result-card {
        background: var(--bg-light);
        border: 1px solid var(--border-medium);
    }
}