/* UK Student Loan Calculator - SMV-inspired Style */

:root {
    --primary: #e8734a;
    --primary-dark: #d4623b;
    --primary-light: #f5a88a;
    --teal: #1a5d5d;
    --teal-light: #2a7a7a;
    --cream: #fdf6ed;
    --cream-dark: #f5ebe0;
    --text: #1a3a3a;
    --text-muted: #5a7a7a;
    --white: #ffffff;
    --border: #e8ddd0;
    --danger: #dc2626;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--cream);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

header h1 span {
    color: var(--primary);
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text);
    margin-top: 1rem;
    line-height: 1.6;
}

.intro-cta {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--teal);
    margin-top: 0.75rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card.compact {
    padding: 1.25rem;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Form elements */
.form-group {
    margin-bottom: 0;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

input, select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--white);
    color: var(--text);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 115, 74, 0.15);
}

/* Input with prefix/suffix */
.input-with-prefix, .input-with-suffix {
    display: flex;
    align-items: stretch;
}

.input-with-prefix span, .input-with-suffix span {
    background: var(--cream);
    border: 2px solid var(--border);
    padding: 0.7rem 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.input-with-prefix span {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}

.input-with-prefix input {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.input-with-suffix span {
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: none;
}

.input-with-suffix input {
    border-radius: var(--radius) 0 0 var(--radius);
}

/* Plan row - Select + Panel side by side */
.plan-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.plan-select {
    flex: 0 0 220px;
}

/* Plan Panel - Pill style stats */
.plan-panel {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.75rem;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.plan-panel.hidden {
    display: none;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.plan-panel .plan-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 0.4rem 0.6rem;
    background: var(--white);
    border-radius: var(--radius);
}

.plan-panel .label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.1rem;
}

.plan-panel .value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

/* Form row layouts */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 1rem;
}

.form-row-single {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-row-single.hidden,
#undergrad-balance-row.hidden,
#postgrad-balance-row.hidden,
#postgrad-row.hidden {
    display: none;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--primary);
    color: var(--white);
    width: 100%;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-teal {
    background: var(--teal);
    color: var(--white);
    border: none;
}

.btn-teal:hover {
    background: var(--teal-light);
}

#calculate-btn {
    margin-top: 0.5rem;
}

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

/* Key Results - Always Visible */
.key-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.key-result {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.key-result.highlight-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid var(--danger);
}

.key-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 180px;
}

.key-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.key-result.highlight-danger .key-value {
    color: var(--danger);
}

.key-subtext {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Stats row - like the 1,500+ / 93% / 150+ section */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* More Details - Expandable */
.more-details {
    margin-top: 0.75rem;
}

.more-details > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--teal);
    padding: 0.75rem 1rem;
    background: var(--cream);
    border-radius: var(--radius-pill);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.more-details > summary::-webkit-details-marker {
    display: none;
}

.more-details > summary::after {
    content: '↓';
    font-size: 0.9rem;
}

.more-details[open] > summary::after {
    content: '↑';
}

.more-details > summary:hover {
    background: var(--cream-dark);
}

.details-content {
    padding: 1.25rem 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (max-width: 500px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.detail-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--teal);
}

/* Freeze comparison - Inside details */
.freeze-comparison {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.freeze-comparison h4 {
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    text-align: center;
}

.freeze-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.freeze-stat {
    background: var(--white);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
}

.freeze-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.freeze-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--teal);
}

/* Yearly breakdown - Collapsible */
.yearly-breakdown {
    margin-top: 0.75rem;
}

.yearly-breakdown summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--teal);
    padding: 0.6rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.yearly-breakdown summary:hover {
    background: var(--cream);
}

.table-container {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.6rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

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

th:first-child, td:first-child {
    text-align: left;
}

tbody tr:hover {
    background: var(--cream);
}

/* MP Section */
.mp-intro {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.mp-lookup-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.mp-lookup-row input {
    flex: 1;
    max-width: 180px;
}

.mp-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: center;
    padding: 1rem;
    background: var(--cream);
    border-radius: var(--radius);
    margin: 1rem 0;
}

.mp-info strong {
    color: var(--teal);
    font-size: 1.1rem;
}

.mp-info span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.mp-info a {
    color: var(--primary);
    font-weight: 500;
}

.email-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.email-actions button {
    flex: 1;
}

.email-preview-details summary {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem;
}

.email-preview {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.5rem;
}

.email-preview input {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.email-preview textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

#results, #mp-section {
    animation: fadeIn 0.4s ease;
}

/* Responsive */
@media (max-width: 700px) {
    .plan-row {
        flex-direction: column;
    }

    .plan-select {
        flex: none;
        width: 100%;
    }

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

    .form-row-3 .form-group:last-child {
        grid-column: span 2;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Print styles */
@media print {
    .btn-primary, .btn-secondary, #mp-section {
        display: none;
    }
}

/* ============================================ */
/* SEO CONTENT ADDITIONS */
/* ============================================ */

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--teal);
    color: var(--white);
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
    top: 0;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 1rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin: 0 0.5rem;
    color: var(--border);
}

.breadcrumb a {
    color: var(--teal);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Updated badge */
.updated-badge {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    background: var(--teal);
    color: var(--white);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Campaign message box */
.campaign-message {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid var(--danger);
    border-radius: var(--radius);
}

.campaign-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

/* Form help text */
.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-help a {
    color: var(--teal);
}

/* Results container - prevent CLS */
.results-container {
    min-height: 200px;
}

/* SEO Content article */
.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.content-section {
    margin-bottom: 2.5rem;
}

.content-section h2 {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 700;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.how-to-list li {
    margin-bottom: 0.75rem;
}

/* Threshold tables */
.threshold-table-container {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.threshold-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.threshold-table th {
    background: var(--teal);
    color: var(--white);
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.threshold-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.threshold-table tbody tr:hover {
    background: var(--cream);
}

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

.table-source {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.table-source a {
    color: var(--teal);
}

/* Related pages navigation */
.related-pages {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.related-pages h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.related-links {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.related-links a {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--cream);
    border-radius: var(--radius);
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.related-links a:hover {
    background: var(--cream-dark);
    transform: translateX(4px);
}

.related-links a::before {
    content: '→ ';
    color: var(--primary);
}

/* Methodology / Trust section */
.methodology {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--cream);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--teal);
}

.methodology h3 {
    font-size: 1rem;
    color: var(--teal);
    margin-bottom: 1rem;
}

.methodology-list {
    margin-bottom: 1rem;
}

.methodology-list dt {
    font-weight: 600;
    color: var(--text);
    margin-top: 0.75rem;
}

.methodology-list dd {
    color: var(--text-muted);
    margin-left: 0;
    font-size: 0.9rem;
}

.methodology-list a {
    color: var(--teal);
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* Footer enhancements */
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.footer-nav {
    display: flex;
    gap: 1rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}

.footer-nav a:hover {
    color: var(--teal);
}

/* Key numbers section highlight */
.key-numbers {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* Mobile responsive for SEO content */
@media (max-width: 600px) {
    .content-section h2 {
        font-size: 1.2rem;
    }

    .threshold-table {
        font-size: 0.8rem;
    }

    .threshold-table th,
    .threshold-table td {
        padding: 0.5rem 0.6rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}
