/* =============================================================
   ssy-calculator.css  —  FairCalculator.com
   Standardized layout with SSY-specific details.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── SCOPED VARIABLES ─────────────────────────────────────── */
.ssy-app-wrapper {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #059669;
    --secondary-dark: #047857;
    --accent: #f59e0b;
    --green: #10b981;
    --red: #ef4444;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-gray: #475569;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --error-bg: #fef2f2;
    --error-border: #fca5a5;
    --error-text: #b91c1c;
    --radius: 12px;
    --radius-sm: 8px;

    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    max-width: 1100px;
    margin: 0 auto;
}

/* ── ERROR BANNER ─────────────────────────────────────────── */
.calc-error-banner {
    display: none;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    color: var(--error-text);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── LAYOUT GRID ──────────────────────────────────────────── */
.calculator-section {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 28px;
    margin-bottom: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .calculator-section {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ── INPUT PANEL ──────────────────────────────────────────── */
.input-panel {
    background: var(--bg-light);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.input-panel h2 {
    color: var(--text-dark);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-panel h2 i {
    color: var(--primary);
}

.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-dark);
}

.input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
}

.symbol-prefix {
    position: absolute;
    left: 13px;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.symbol-suffix {
    position: absolute;
    right: 13px;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.input-with-symbol input {
    padding-left: 36px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-helper {
    font-size: 0.76rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* ── SLIDER ───────────────────────────────────────────────── */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex-grow: 1;
    height: 6px;
    background: linear-gradient(90deg, var(--primary) var(--pct, 50%), #e5e7eb var(--pct, 50%));
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2.5px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}

input.inline-number-input {
    width: 75px !important;
    text-align: center;
    font-weight: 700;
}

/* ── CALCULATE BUTTON ─────────────────────────────────────── */
.calc-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ── RESULTS PANEL ────────────────────────────────────────── */
.results-panel {
    background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
    color: white;
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 90px;
}

@media (max-width: 900px) {
    .results-panel {
        position: static;
    }
}

.results-panel h2 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 18px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.res-main-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.res-main-card .res-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin-bottom: 8px;
}

.res-main-card .res-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fbbf24;
}

.res-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.res-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.res-card .res-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 5px;
}

.res-card .res-value {
    font-size: 1.15rem;
    font-weight: 700;
}

/* ── DONUT ── */
.donut-wrapper {
    background: rgba(0, 0, 0, 0.15);
    padding: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
}

#donut-chart {
    flex-shrink: 0;
    overflow: visible;
}

.donut-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 14;
}

.donut-invested {
    fill: none;
    stroke: #ffffff;
    stroke-width: 14;
    transform: rotate(-90deg);
    transform-origin: 64px 64px;
    transition: stroke-dasharray 0.6s;
}

.donut-interest {
    fill: none;
    stroke: #fbbf24;
    stroke-width: 14;
    transform: rotate(-90deg);
    transform-origin: 64px 64px;
    transition: all 0.6s;
}

.donut-legend {
    font-size: 0.8rem;
    flex-grow: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.dot-inv {
    background: #fff;
}

.dot-int {
    background: #fbbf24;
}

/* ── SCHEDULE ── */
.schedule-section {
    background: white;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.schedule-table-container {
    overflow-x: auto;
    max-height: 400px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    background: var(--bg-light);
    padding: 12px;
    text-align: right;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
}

td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

th:first-child,
td:first-child {
    text-align: left;
}

tr:hover {
    background: #f9fafb;
}

@media (max-width: 600px) {
    .donut-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .res-main-card .res-value {
        font-size: 1.8rem;
    }
}