/* 
    Design System for ILR Calculator UK 
    Premium, Authoritative, and Modern
*/

:root {
    /* Colors */
    --primary: #1c2540;
    --primary-light: #2a375a;
    --accent: #d4af37;
    --accent-hover: #b8962d;
    --text-dark: #1a1a1a;
    --text-muted: #666666;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --error: #dc3545;
    --success: #28a745;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

p {
    margin-bottom: 1.25rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Utils */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Section visibility for SPA */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

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

/* Layout Components */
header {
    height: var(--header-height);
    background-color: var(--primary);
    color: var(--text-light);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

nav ul {
    display: flex;
    gap: 2rem;
}

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

/* Hero Section */
.hero {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p.lead {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

/* Quick Check Card */
.quick-check {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.quick-check h3 {
    font-family: var(--font-body);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.quick-check p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.calc-list {
    margin-top: 1.5rem;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.calc-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

/* Feature Bar */
.feature-bar {
    background: var(--white);
    padding: 3rem 0;
    border-bottom: 1px solid #eee;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.feature-text h4 {
    font-family: var(--font-body);
    font-size: 1rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.feature-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Calculator Section */
.calc-section {
    padding: 5rem 0;
    background: var(--bg-light);
}

.calc-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

select, input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
}

.result-card {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--primary);
    color: var(--text-light);
    border-radius: var(--radius-md);
    display: none;
}

.result-card.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

/* Risk Score & Details */
.risk-indicator {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.risk-low { background: #d4edda; color: #155724; }
.risk-medium { background: #fff3cd; color: #856404; }
.risk-high { background: #f8d7da; color: #721c24; }

.cost-projection {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    text-align: left;
}

.cost-projection h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.cost-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cost-total {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Content Sections Expansion */
.content-section table th, .content-section table td {
    padding: 1rem;
    border: 1px solid #eee;
    text-align: left;
}
.content-section {
    padding: 5rem 0;
}

.content-grid {
    max-width: 900px;
    margin: 0 auto;
}

.content-section h2 {
    font-size: 2.2rem;
    color: var(--primary);
}

.content-section h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    color: var(--primary);
}

/* FAQ Accordion */
.faq-section {
    background: var(--bg-light);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #eee;
}

.faq-question {
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 500px;
}

.faq-item.active .faq-question {
    color: var(--accent);
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--text-light);
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Mobile Menu */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    nav {
        display: none; /* Add JS for drawer later */
    }
    .mobile-toggle {
        display: block;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
