/* wino123.com - Professional Financial Calculator CSS */

/* CSS Variables */
:root {
    --primary: #1a1a1a;
    --accent: #f97316;
    --accent-light: #fff7ed;
    --text: #1a1a1a;
    --text-secondary: #525252;
    --text-muted: #737373;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --border: #e5e7eb;
    --radius: 6px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.03em;
    font-family: 'Inter', sans-serif;
}

.logo span {
    color: var(--accent);
}

/* Navigation */
nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 12px 0;
    overflow-x: auto;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: color 0.15s;
    white-space: nowrap;
}

nav a:hover {
    color: var(--text);
}

nav a.active {
    color: var(--accent);
    position: relative;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* Main */
main {
    padding: 48px 0;
    min-height: calc(100vh - 160px);
}

/* Hero */
.hero {
    text-align: center;
    padding: 24px 0 48px;
}

.hero h1 {
    font-size: 38px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 400;
}

.trust-indicators {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
}

.trust-indicators span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 32px 0;
    background: var(--bg-alt);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.calc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.calc-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.12);
}

.calc-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.calc-icon i, .calc-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
    display: block;
}

.calc-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.calc-card p {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* FAQ Section */
.faq-section {
    padding-top: 48px;
}

.faq-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

.faq-item {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-question {
    padding: 14px 16px;
    background: var(--bg-alt);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: var(--text-muted);
}

.faq-item.active .faq-question::after {
    content: '−';
    color: var(--accent);
}

.faq-answer {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, padding 0.2s ease;
}

.faq-item.active .faq-answer {
    padding: 14px 16px;
    max-height: 200px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    text-align: left;
}

/* Footer */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
}

footer p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Calculator Page Styles */
.calculator-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 32px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.calculator-card.wide {
    max-width: 700px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    text-align: center;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

p {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
}

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

label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 6px;
}

input, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:hover, select:hover {
    border-color: #c4c4c4;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 6px;
}

.btn:hover {
    background: #ea580c;
}

/* Result Box */
.result-box {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0;
}

/* Calculator Split Layout */
.calculator-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 640px) {
    .calculator-split {
        grid-template-columns: 1fr;
    }
}

/* Input Groups with Sliders */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.input-group label span {
    font-weight: 600;
    color: var(--accent);
    font-size: 15px;
}

.slider-container {
    position: relative;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    padding: 0;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid var(--bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Result Section */
.result-section {
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

/* Pie Chart */
.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(var(--accent) 0deg, var(--accent) var(--angle), #e5e7eb var(--angle), #e5e7eb 360deg);
}

.pie-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: var(--bg-alt);
    border-radius: 50%;
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.pie-center .amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.pie-center .label {
    font-size: 11px;
    color: var(--text-muted);
}

.pie-legend {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pie-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.pie-legend-color.principal {
    background: var(--accent);
}

/* Result Summary */
.result-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

@media (max-width: 480px) {
    .result-summary {
        grid-template-columns: 1fr;
    }
}

.result-summary-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 8px;
    text-align: center;
}

.result-summary-card .label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.result-summary-card .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Amortization Table */
.amortization-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.amortization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.amortization-header h3 {
    margin: 0;
    font-size: 16px;
}

.table-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg-alt);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

tr:nth-child(even) {
    background: var(--bg-alt);
}

td {
    color: var(--text-secondary);
}

.table-year {
    font-weight: 600;
    color: var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
    
    .hero h1 {
        font-size: 26px;
    }
    
    .hero-subtitle {
        font-size: 15px;
    }
    
    .trust-indicators {
        font-size: 12px;
        gap: 12px;
    }
    
    .calculator-grid {
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .calc-card {
        padding: 20px;
    }
    
    .calculator-card {
        padding: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .result-value {
        font-size: 26px;
    }
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print */
@media print {
    nav, footer, .btn {
        display: none;
    }
}

/* Loan Calculator Styles */
.loan-badge {
    font-size: 11px;
    font-weight: 500;
    background: #fff7ed;
    color: #f97316;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.additional-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.loan-options {
    display: block;
}

.dynamic-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
