/* =============================================================
   DAILY CURRENT AFFAIRS — PREMIUM SHARED STYLESHEET
   Built for the current templates:
   index.html, news.html, quiz.html, result.html,
   history.html, login.html, signup.html
   Theme: forest green, soft sage, white cards, responsive layout
============================================================= */

/* -------------------- Design tokens & reset -------------------- */
:root {
    --primary: #176b55;
    --primary-dark: #104c3e;
    --primary-deep: #0b3b30;
    --primary-soft: #eaf5ef;
    --primary-pale: #f3f9f5;
    --background: #f5f8f6;
    --surface: #ffffff;
    --text: #172b25;
    --muted: #687770;
    --border: #e2e9e5;
    --border-strong: #cbdcd2;
    --danger: #ad3939;
    --danger-bg: #fff1f0;
    --success: #176b43;
    --success-bg: #e9f7ee;
    --shadow-sm: 0 4px 16px rgba(20, 65, 47, 0.045);
    --shadow-md: 0 12px 30px rgba(20, 65, 47, 0.075);
    --radius-sm: 9px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --content-width: 1160px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(39, 137, 84, 0.32);
    outline-offset: 3px;
}

/* -------------------- Shared navigation -------------------- */
.navbar {
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: 76px;
    padding: 14px clamp(20px, 6.5vw, 96px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
}

.brand:hover {
    color: var(--primary-dark);
}

.brand-icon {
    width: 43px;
    min-width: 43px;
    height: 43px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-link:hover,
.back-link:hover {
    border-color: #dcebe1;
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 9px 15px;
    border: 1px solid var(--primary);
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.nav-signup:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.welcome-user {
    display: inline-flex;
    align-items: center;
    max-width: 190px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

.logout-btn {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.logout-btn:hover {
    border-color: #b6d5c2;
    background: var(--primary-soft);
}

/* -------------------- Shared buttons -------------------- */
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 18px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(23, 107, 85, 0.09);
}

.primary-btn:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 15px rgba(16, 76, 62, 0.14);
}

.secondary-btn {
    border-color: #cfe1d6;
    background: #fff;
    color: var(--primary);
}

.secondary-btn:hover {
    border-color: #a9cbb7;
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

/* -------------------- Shared labels, messages & footer -------------------- */
.section-label {
    display: inline-block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.25px;
    line-height: 1.5;
    text-transform: uppercase;
}

.messages-container {
    width: min(var(--content-width), 90%);
    margin: 0 auto;
}

.flash-message {
    margin: 15px 0;
    padding: 12px 15px;
    border: 1px solid #d4e8da;
    border-radius: 10px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.flash-message.error,
.flash-message.danger {
    border-color: #f0cdca;
    background: var(--danger-bg);
    color: var(--danger);
}

.flash-message.warning {
    border-color: #f0dfb4;
    background: #fff8e8;
    color: #805b13;
}

.footer {
    width: 100%;
    margin-top: auto;
    padding: 28px 22px 22px;
    border-top: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text);
}

.footer-brand .brand-icon {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 10px;
}

.footer-brand strong {
    font-size: 14px;
    font-weight: 800;
}

.footer p {
    margin: 5px 0 0;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px 20px;
    margin: 16px 0 10px;
}

.footer-links a,
.footer > a {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.footer-links a:hover,
.footer > a:hover {
    text-decoration: underline;
}

.copyright {
    margin-top: 13px !important;
    color: #8a9690;
    font-size: 11px;
}

/* =============================================================
   1. HOMEPAGE — index.html (.home-page)
============================================================= */
.home-page {
    background: var(--background);
}

.home-page .navbar {
    padding-top: 15px;
    padding-bottom: 15px;
}

.home-page .hero {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: clamp(64px, 8vw, 105px) 7%;
    background: linear-gradient(125deg, #e8f5ec 0%, #f7fbf8 64%, #eef7f1 100%);
    border-bottom: 1px solid #e0ebe3;
}

.home-page .hero::after {
    position: absolute;
    right: -85px;
    top: -115px;
    width: 350px;
    height: 350px;
    border: 1px solid rgba(23, 107, 85, 0.08);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(23, 107, 85, 0.025), 0 0 0 72px rgba(23, 107, 85, 0.02);
    content: "";
    pointer-events: none;
}

.home-page .hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.home-page .hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    border: 1px solid #cfe5d7;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.home-page .hero h1 {
    max-width: 800px;
    margin: 20px 0 0;
    color: var(--text);
    font-size: clamp(40px, 6vw, 68px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2px;
}

.home-page .hero h1 span {
    display: inline-block;
    color: var(--primary);
}

.home-page .hero-content > p {
    max-width: 720px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.85;
}

.home-page .hero-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 29px;
}

.home-page .user-welcome {
    margin-top: 20px !important;
    color: var(--primary-dark) !important;
    font-size: 14px !important;
    font-weight: 700;
}

.home-page .main-container {
    width: min(var(--content-width), 90%);
    margin: 55px auto 68px;
}

.home-page .section-heading {
    margin: 0 auto 30px;
    text-align: center;
}

.home-page .section-heading h2 {
    margin: 10px 0 0;
    color: var(--text);
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.home-page .section-heading p {
    margin: 10px auto 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.home-page .features-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
}

.home-page .feature-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 250px;
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-page .feature-card:hover {
    transform: translateY(-4px);
    border-color: #bad9c6;
    box-shadow: var(--shadow-md);
}

.home-page .feature-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border: 1px solid #d7eadf;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.home-page .feature-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.45;
}

.home-page .feature-card p {
    margin: 10px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.home-page .feature-link {
    display: inline-block;
    margin-top: auto;
    padding-top: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.home-page .feature-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.home-page .language-section {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 35px;
    margin-top: 42px;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid #dce9df;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #edf7f0, #fff 80%);
}

.home-page .language-content h2 {
    margin: 10px 0 0;
    color: var(--text);
    font-size: clamp(23px, 2.7vw, 31px);
    line-height: 1.3;
}

.home-page .language-content p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.home-page .language-buttons {
    display: grid;
    gap: 12px;
}

.home-page .language-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.home-page .language-card:hover {
    transform: translateY(-2px);
    border-color: #b5d7c2;
    box-shadow: var(--shadow-sm);
}

.home-page .language-code {
    display: grid;
    place-items: center;
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 16px;
    font-weight: 800;
}

.home-page .language-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.home-page .language-details strong {
    color: var(--text);
    font-size: 14px;
}

.home-page .language-details small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.home-page .language-arrow {
    color: var(--primary);
    font-size: 23px;
    font-weight: 700;
}

.home-page .account-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 30px;
    padding: 26px 29px;
    border: 1px solid #d8e8de;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.home-page .account-cta h2 {
    color: var(--text);
    font-size: 21px;
    line-height: 1.4;
}

.home-page .account-cta p {
    max-width: 700px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.home-page .account-cta .primary-btn {
    flex-shrink: 0;
}

/* =============================================================
   2. NEWS DASHBOARD — news.html (.news-page)
============================================================= */
.news-page {
    background: var(--background);
}

.news-page .navbar {
    padding-top: 15px;
    padding-bottom: 15px;
}

.news-page .nav-links {
    gap: 6px;
}

.news-page .nav-signup {
    margin: 0 2px;
}

.news-page .news-hero {
    width: 100%;
    padding: clamp(48px, 6.5vw, 76px) 7%;
    border-bottom: 1px solid #dfeae3;
    background: linear-gradient(130deg, #e7f4eb 0%, #f8fbf9 68%, #f0f8f2 100%);
}

.news-page .news-hero-content {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.news-page .news-hero h1 {
    margin: 13px 0 14px;
    color: #17372a;
    font-size: clamp(36px, 5.2vw, 60px);
    font-weight: 800;
    line-height: 1.13;
    letter-spacing: -1.3px;
}

.news-page .news-hero p {
    max-width: 760px;
    margin: 0;
    color: #627568;
    font-size: 16px;
    line-height: 1.85;
}

.news-page .news-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.news-page .news-container {
    width: min(var(--content-width), 90%);
    margin: 36px auto 62px;
}

.news-page .news-container > .messages-container {
    width: 100%;
    max-width: none;
    margin: 0 0 12px;
}

.news-page .audio-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 28px;
    width: 100%;
    min-width: 0;
    margin: 0 0 42px;
    padding: 25px 28px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(125deg, #104c3e, #176b55);
    color: #fff;
    box-shadow: 0 12px 28px rgba(16, 76, 62, 0.13);
}

.news-page .audio-panel-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1 1 280px;
    min-width: 0;
}

.news-page .audio-panel-heading > div:last-child {
    min-width: 0;
}

.news-page .audio-icon {
    display: grid;
    place-items: center;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    height: 54px;
    flex: 0 0 54px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font-size: 27px;
    line-height: 1;
}

.news-page .audio-panel-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 23px;
    line-height: 1.35;
}

.news-page .audio-panel-heading p {
    margin: 5px 0 0;
    color: #dfefe7;
    font-size: 14px;
    line-height: 1.7;
}

.news-page .audio-form {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
}

.news-page .audio-generate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 1px solid #fff;
    border-radius: 10px;
    background: #fff;
    color: #104c3e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    white-space: normal;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-page .audio-generate-btn:hover {
    transform: translateY(-1px);
    background: #eaf5ef;
}

.news-page .audio-player {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    padding: 13px 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.11);
}

.news-page .audio-player audio {
    display: block;
    width: 100%;
    max-width: 700px;
    margin: 0;
}

.news-page .news-empty-note {
    flex: 1 0 100%;
    margin: 0;
    color: #e2eee8;
    font-size: 13px;
}

.news-page .audio-panel > .flash-message {
    flex: 1 0 100%;
    margin: 0;
}

.news-page .news-list-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 22px;
}

.news-page .news-list-heading h2 {
    margin: 8px 0 5px;
    color: var(--text);
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.3;
    letter-spacing: -0.45px;
}

.news-page .news-list-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.news-page .news-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 7px 12px;
    border: 1px solid #d6e9dd;
    border-radius: 30px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.news-page .news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    margin: 0 0 34px;
}

.news-page .news-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 280px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-page .news-card:hover {
    transform: translateY(-3px);
    border-color: #bdd9c7;
    box-shadow: var(--shadow-md);
}

.news-page .news-card-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.news-page .news-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #50685b;
    font-size: 13px;
    font-weight: 700;
}

.news-page .news-category {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid #e0eee5;
    border-radius: 30px;
    background: #edf7f1;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.news-page .news-card h3 {
    margin: 15px 0 10px;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.news-page .news-description {
    margin: 0 0 18px;
    color: #627568;
    font-size: 13px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.news-page .news-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid #edf1ee;
}

.news-page .news-metadata {
    display: flex;
    flex: 1 1 130px;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    color: #819087;
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.news-page .read-source-link {
    display: inline-block;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.news-page .read-source-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.news-page .news-empty-state {
    padding: 38px 25px;
    border: 1px dashed #cbded2;
    border-radius: 17px;
    background: #fff;
    text-align: center;
}

.news-page .news-empty-state h2 {
    color: var(--text);
    font-size: 23px;
}

.news-page .news-empty-state p {
    max-width: 700px;
    margin: 10px auto 20px;
    color: var(--muted);
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.news-page .news-quiz-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    padding: 27px 29px;
    border: 1px solid #d7e8de;
    border-radius: 18px;
    background: linear-gradient(120deg, #fff, #edf7f0);
    box-shadow: var(--shadow-sm);
}

.news-page .news-quiz-cta h2 {
    margin: 8px 0 5px;
    color: var(--text);
    font-size: 23px;
    line-height: 1.4;
}

.news-page .news-quiz-cta p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.news-page .news-quiz-cta .primary-btn {
    flex-shrink: 0;
}

.news-page .footer {
    padding-top: 27px;
}

/* =============================================================
   3. QUIZ PAGE — quiz.html (.quiz-page)
============================================================= */
.quiz-page {
    background: var(--background);
}

.quiz-page .navbar .nav-links {
    gap: 7px;
}

.quiz-page .quiz-hero {
    width: 100%;
    padding: clamp(42px, 5.8vw, 66px) 7%;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(130deg, #e8f5ec, #f9fcfa 76%);
}

.quiz-page .quiz-hero-content {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.quiz-page .quiz-hero h1 {
    max-width: 900px;
    margin: 12px 0 0;
    color: #17372a;
    font-size: clamp(32px, 4.8vw, 48px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.9px;
}

.quiz-page .quiz-hero p {
    max-width: 720px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.85;
}

.quiz-page .messages-container {
    width: min(1000px, 90%);
}

.quiz-page .quiz-container {
    width: min(1000px, 90%);
    margin: 35px auto 62px;
}

.quiz-page .quiz-info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin: 0 0 23px;
    padding: 23px 25px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.quiz-page .quiz-info-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    line-height: 1.4;
}

.quiz-page .quiz-info-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.quiz-page .quiz-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #d6e9dd;
    border-radius: 30px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.quiz-page .quiz-form {
    margin: 0;
}

.quiz-page .question-card {
    min-width: 0;
    margin: 0 0 19px;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.quiz-page .question-card:focus-within {
    border-color: #b7d8c4;
    box-shadow: 0 8px 25px rgba(20, 65, 47, 0.065);
}

.quiz-page .question-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 18px;
}

.quiz-page .question-number {
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.quiz-page .question-heading {
    flex: 1;
    min-width: 0;
}

.quiz-page .question-heading h3 {
    margin: 1px 0 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.quiz-page .question-type {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 9px;
    border: 1px solid #e0ece3;
    border-radius: 20px;
    background: #f2f8f4;
    color: #60776a;
    font-size: 11px;
    font-weight: 700;
}

.quiz-page .question-summary {
    margin: 15px 0 18px;
    padding: 14px 16px;
    border: 1px solid #dcece1;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: #f5faf6;
    color: #53675c;
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.quiz-page .question-summary strong {
    color: var(--primary);
}

.quiz-page .options-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.quiz-page .option-label {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 62px;
    padding: 12px 14px;
    border: 1px solid #dfe9e2;
    border-radius: 12px;
    background: #fff;
    color: #294536;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quiz-page .option-label:hover {
    border-color: #9dc9ac;
    background: #f7fbf8;
}

.quiz-page .option-label:has(input:checked) {
    border-color: #278954;
    background: #eaf7ee;
    box-shadow: inset 0 0 0 1px rgba(39, 137, 84, 0.10);
}

.quiz-page .option-label input[type="radio"] {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.quiz-page .option-letter {
    display: inline-grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #edf5f0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.quiz-page .option-text {
    flex: 1;
    min-width: 0;
    color: #294536;
    font-size: 13px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.quiz-page .quiz-submit-card {
    margin-top: 27px;
    padding: 27px;
    border: 1px solid #d7e8de;
    border-radius: 17px;
    background: linear-gradient(120deg, #fff, #edf7f0);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.quiz-page .quiz-submit-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
}

.quiz-page .quiz-submit-card p {
    margin: 7px 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.quiz-page .quiz-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 47px;
    padding: 12px 25px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.quiz-page .quiz-submit-btn:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
    box-shadow: 0 8px 17px rgba(16, 76, 62, 0.14);
}

.quiz-page .quiz-empty-state {
    padding: 45px 25px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.quiz-page .quiz-empty-state h2 {
    color: var(--text);
    font-size: 23px;
}

.quiz-page .quiz-empty-state p {
    max-width: 600px;
    margin: 10px auto 23px;
    color: var(--muted);
    line-height: 1.8;
}

/* =============================================================
   4. RESULT PAGE — result.html (.result-page)
============================================================= */
.result-page {
    background: var(--background);
}

.result-page .result-hero {
    width: 100%;
    padding: clamp(42px, 5.8vw, 66px) 7%;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(130deg, #e8f5ec, #f9fcfa 76%);
}

.result-page .result-hero-content {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.result-page .result-hero h1 {
    margin: 12px 0 0;
    color: #17372a;
    font-size: clamp(32px, 4.8vw, 48px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.9px;
}

.result-page .result-hero p {
    max-width: 780px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.85;
}

.result-page .result-container {
    width: min(1000px, 90%);
    margin: 35px auto 65px;
}

.result-page .result-summary-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 32px;
    padding: 30px;
    border: 1px solid #d8e8de;
    border-radius: 21px;
    background: linear-gradient(130deg, #fff 0%, #f0f8f3 100%);
    box-shadow: var(--shadow-sm);
}

.result-page .score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 170px;
    height: 170px;
    margin: 0 auto;
    border: 9px solid #d8ede0;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #edf6f0, 0 7px 20px rgba(23, 107, 85, 0.08);
    text-align: center;
}

.result-page .score-circle strong {
    color: var(--primary);
    font-size: 37px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.8px;
}

.result-page .score-circle span {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.result-page .score-details {
    min-width: 0;
}

.result-page .score-details h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(23px, 3vw, 30px);
    line-height: 1.35;
}

.result-page .score-details > p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.result-page .score-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    margin-top: 23px;
}

.result-page .score-stat {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.result-page .score-stat .stat-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.result-page .score-stat strong {
    display: block;
    margin-top: 5px;
    color: var(--primary);
    font-size: 25px;
    line-height: 1.25;
}

.result-page .score-stat.incorrect-stat strong {
    color: var(--danger);
}

.result-page .score-stat.total-stat strong {
    color: #5265a8;
}

.result-page .result-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    margin: 23px 0 43px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.result-page .answer-review-section {
    margin-top: 0;
}

.result-page .review-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 22px;
}

.result-page .review-heading h2 {
    margin: 8px 0 5px;
    color: var(--text);
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.3;
}

.result-page .review-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.result-page .review-count {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid #d6e9dd;
    border-radius: 30px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.result-page .answer-review-list {
    display: grid;
    gap: 17px;
}

.result-page .answer-card {
    min-width: 0;
    padding: 23px;
    border: 1px solid var(--border);
    border-left: 4px solid #d5a3a0;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.result-page .answer-card:has(.status-correct) {
    border-left-color: #3c9a63;
}

.result-page .answer-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.result-page .answer-card-header .question-number {
    display: inline-grid;
    place-items: center;
    width: 39px;
    min-width: 39px;
    height: 39px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.result-page .answer-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 6px 11px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
}

.result-page .status-correct {
    border: 1px solid #d2eadb;
    background: #e8f6ed;
    color: #176b43;
}

.result-page .status-incorrect {
    border: 1px solid #f0d1cf;
    background: #fff0ef;
    color: #ad3939;
}

.result-page .answer-question {
    margin: 0 0 17px;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.result-page .answer-context {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #dcece1;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: #f5faf6;
    color: #53675c;
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.result-page .answer-context strong {
    color: var(--primary);
}

.result-page .answer-detail {
    display: grid;
    grid-template-columns: minmax(115px, 150px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 13px 0;
    border-top: 1px solid #edf1ee;
}

.result-page .answer-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.result-page .answer-detail p {
    min-width: 0;
    margin: 0;
    color: #314c3d;
    font-size: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.result-page .answer-correct-text {
    color: #176b43 !important;
    font-weight: 700;
}

.result-page .answer-wrong-text {
    color: #ad3939 !important;
    font-weight: 700;
}

.result-page .answer-explanation {
    margin-top: 16px;
    padding: 16px 17px;
    border: 1px solid #dcece1;
    border-radius: 12px;
    background: #f4f9f5;
    color: #53675c;
    font-size: 13px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.result-page .answer-explanation strong {
    color: var(--primary);
}

.result-page .answer-explanation p {
    margin: 6px 0 0;
}

.result-page .empty-state {
    padding: 35px 22px;
    border: 1px dashed var(--border-strong);
    border-radius: 15px;
    background: #fff;
    text-align: center;
}

.result-page .empty-state h3 {
    color: var(--text);
    font-size: 20px;
}

.result-page .empty-state p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.result-page .result-bottom-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 28px;
    padding: 25px 27px;
    border: 1px solid #d8e8de;
    border-radius: 17px;
    background: linear-gradient(120deg, #fff, #edf7f0);
}

.result-page .result-bottom-cta h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}

.result-page .result-bottom-cta p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.result-page .result-bottom-cta .primary-btn {
    flex-shrink: 0;
}

/* =============================================================
   5. HISTORY PAGE — history.html (.history-page)
============================================================= */
.history-page {
    background: var(--background);
}

.history-page .history-hero {
    padding: clamp(42px, 5.8vw, 66px) 7%;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(130deg, #e8f5ec, #f9fcfa 76%);
}

.history-page .history-hero-content {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.history-page .history-hero h1 {
    margin: 12px 0 0;
    color: #17372a;
    font-size: clamp(32px, 4.7vw, 47px);
    line-height: 1.2;
    letter-spacing: -0.8px;
}

.history-page .history-hero p {
    max-width: 760px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

.history-page .history-container {
    width: min(1100px, 90%);
    margin: 34px auto 60px;
}

.history-page .history-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 25px;
}

.history-page .history-stat-card {
    min-width: 0;
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.history-page .history-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-page .history-stat-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.history-page .history-stat-card strong {
    display: block;
    margin-top: 10px;
    color: var(--primary);
    font-size: clamp(27px, 3vw, 34px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.history-page .history-stat-card p {
    margin: 7px 0 0;
    color: #87938c;
    font-size: 12px;
    line-height: 1.7;
}

.history-page .history-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.history-page .history-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 23px 25px;
    border-bottom: 1px solid #e8efea;
}

.history-page .history-panel-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    line-height: 1.4;
}

.history-page .history-panel-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.history-page .history-panel-heading .primary-btn {
    flex-shrink: 0;
}

.history-page .history-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.history-page .history-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    background: #fff;
    text-align: left;
}

.history-page .history-table thead {
    background: #f4f9f5;
}

.history-page .history-table th,
.history-page .history-table td {
    padding: 15px 19px;
    border-bottom: 1px solid #edf1ee;
    font-size: 13px;
    vertical-align: middle;
}

.history-page .history-table th {
    color: #607367;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.history-page .history-table td {
    color: #334b3d;
}

.history-page .history-table tbody tr:last-child td {
    border-bottom: 0;
}

.history-page .history-table tbody tr:hover {
    background: #f8fbf8;
}

.history-page .attempt-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 5px 9px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.history-page .history-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #d9ebdf;
    border-radius: 30px;
    background: #eaf7ee;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.history-page .history-date {
    color: #77867c !important;
    font-size: 12px !important;
    white-space: nowrap;
}

.history-page .history-empty-state {
    padding: 44px 22px;
    text-align: center;
}

.history-page .history-empty-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 17px;
    background: var(--primary-soft);
    font-size: 28px;
}

.history-page .history-empty-state h3 {
    color: var(--text);
    font-size: 21px;
}

.history-page .history-empty-state p {
    max-width: 520px;
    margin: 9px auto 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.history-page .history-bottom-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 25px;
    padding: 24px 26px;
    border: 1px solid #d8e8de;
    border-radius: 17px;
    background: linear-gradient(120deg, #fff, #edf7f0);
}

.history-page .history-bottom-cta h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}

.history-page .history-bottom-cta p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.history-page .history-bottom-cta .secondary-btn {
    flex-shrink: 0;
}

/* =============================================================
   6. LOGIN & SIGNUP — auth.html (.auth-page)
============================================================= */
.auth-page {
    background: linear-gradient(180deg, #f4f8f5 0%, #edf5ef 100%);
}

.auth-page .navbar {
    padding-top: 14px;
    padding-bottom: 14px;
}

.auth-page .auth-container {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 45px 20px;
}

.auth-page .auth-card {
    width: 100%;
    max-width: 465px;
    padding: clamp(25px, 5vw, 38px);
    border: 1px solid #dfe9e2;
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(20, 65, 47, 0.09);
}

.auth-page .auth-heading {
    margin: 0 0 27px;
    text-align: center;
}

.auth-page .auth-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 15px;
    border: 1px solid #d3e9db;
    border-radius: 16px;
    background: #e8f6ed;
    color: var(--primary);
    font-size: 25px;
    font-weight: 800;
}

.auth-page .auth-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 27px;
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.auth-page .auth-heading p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.auth-page .auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
}

.auth-page .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-page .form-group label {
    color: #294536;
    font-size: 12px;
    font-weight: 800;
}

.auth-page .form-group input {
    width: 100%;
    min-height: 47px;
    padding: 12px 14px;
    border: 1px solid #d9e5dc;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-page .form-group input::placeholder {
    color: #9aa69f;
}

.auth-page .form-group input:focus {
    border-color: #4b9b6b;
    box-shadow: 0 0 0 4px rgba(39, 137, 84, 0.10);
}

.auth-page .auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 49px;
    margin-top: 2px;
    padding: 12px 18px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-page .auth-button:hover {
    transform: translateY(-1px);
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    box-shadow: 0 7px 16px rgba(16, 76, 62, 0.13);
}

.auth-page .auth-switch {
    margin: 22px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.auth-page .auth-switch a {
    color: var(--primary);
    font-weight: 800;
}

.auth-page .auth-switch a:hover {
    text-decoration: underline;
}

.auth-page .auth-home-link {
    margin-top: 18px;
    text-align: center;
}

.auth-page .auth-home-link a {
    color: #718176;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.auth-page .auth-home-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* =============================================================
   7. RESPONSIVE RULES — every page
============================================================= */
@media (max-width: 1000px) {
    .home-page .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-page .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-page .language-section {
        gap: 24px;
    }
}

@media (max-width: 760px) {
    .navbar {
        padding: 13px 5%;
        gap: 13px;
    }

    .brand {
        font-size: 16px;
    }

    .brand-icon {
        width: 39px;
        min-width: 39px;
        height: 39px;
        border-radius: 11px;
    }

    .nav-links {
        justify-content: flex-start;
        gap: 5px;
    }

    .nav-link {
        padding: 7px 9px;
        font-size: 12px;
    }

    .welcome-user {
        max-width: 130px;
        font-size: 12px;
    }

    .home-page .hero {
        padding: 58px 5%;
    }

    .home-page .hero h1 {
        font-size: clamp(38px, 8vw, 54px);
        letter-spacing: -1.2px;
    }

    .home-page .main-container {
        width: 92%;
        margin: 40px auto 48px;
    }

    .home-page .language-section {
        grid-template-columns: 1fr;
    }

    .home-page .account-cta,
    .news-page .news-quiz-cta,
    .history-page .history-bottom-cta,
    .result-page .result-bottom-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-page .account-cta .primary-btn,
    .news-page .news-quiz-cta .primary-btn,
    .history-page .history-bottom-cta .secondary-btn,
    .result-page .result-bottom-cta .primary-btn {
        width: 100%;
    }

    .news-page .news-hero,
    .quiz-page .quiz-hero,
    .result-page .result-hero,
    .history-page .history-hero {
        padding: 42px 5%;
    }

    .news-page .news-container,
    .quiz-page .quiz-container,
    .result-page .result-container,
    .history-page .history-container {
        width: 92%;
        margin-top: 26px;
        margin-bottom: 45px;
    }

    .news-page .audio-panel {
        padding: 21px;
        gap: 17px;
    }

    .news-page .audio-panel-heading {
        flex-basis: 100%;
    }

    .news-page .audio-form {
        width: 100%;
    }

    .news-page .audio-generate-btn {
        width: 100%;
    }

    .news-page .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .news-page .news-card {
        padding: 18px;
    }

    .quiz-page .options-list {
        grid-template-columns: 1fr;
    }

    .quiz-page .question-card {
        padding: 20px;
    }

    .quiz-page .quiz-submit-card {
        padding: 23px 18px;
    }

    .quiz-page .quiz-submit-btn {
        width: 100%;
    }

    .result-page .result-summary-card {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 24px;
        text-align: center;
    }

    .result-page .score-details > p {
        margin-left: auto;
        margin-right: auto;
    }

    .result-page .score-stats {
        text-align: left;
    }

    .result-page .answer-detail {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .history-page .history-stats {
        grid-template-columns: 1fr;
    }

    .history-page .history-stat-card {
        padding: 19px;
    }

    .history-page .history-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .history-page .history-panel-heading .primary-btn {
        width: 100%;
    }

    .auth-page .auth-container {
        padding: 30px 16px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 14px;
    }

    .home-page .features-grid,
    .news-page .news-grid {
        grid-template-columns: 1fr;
    }

    .home-page .feature-card {
        min-height: auto;
    }

    .home-page .hero-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .home-page .hero-buttons a {
        width: 100%;
    }

    .news-page .news-hero h1,
    .quiz-page .quiz-hero h1,
    .result-page .result-hero h1,
    .history-page .history-hero h1 {
        font-size: 32px;
        letter-spacing: -0.5px;
    }

    .news-page .news-list-heading,
    .result-page .review-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .news-page .news-card {
        min-height: 0;
        padding: 20px;
    }

    .news-page .news-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .quiz-page .quiz-info-card {
        align-items: flex-start;
        flex-direction: column;
        padding: 19px;
    }

    .quiz-page .question-card {
        padding: 17px;
    }

    .quiz-page .question-heading h3 {
        font-size: 15px;
    }

    .quiz-page .option-label {
        padding: 11px;
        gap: 9px;
    }

    .result-page .score-circle {
        width: 150px;
        height: 150px;
        border-width: 8px;
    }

    .result-page .score-circle strong {
        font-size: 32px;
    }

    .result-page .score-stats {
        grid-template-columns: 1fr;
    }

    .result-page .result-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 16px;
    }

    .result-page .result-actions .primary-btn,
    .result-page .result-actions .secondary-btn {
        width: 100%;
    }

    .result-page .answer-card {
        padding: 18px;
    }

    .history-page .history-panel-heading {
        padding: 18px;
    }

    .history-page .history-table th,
    .history-page .history-table td {
        padding: 12px 14px;
    }

    .auth-page .auth-card {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .auth-page .auth-heading h1 {
        font-size: 24px;
    }

    .footer {
        padding: 23px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==================================================
   MOCK TESTS + UPDATED DASHBOARD CARD
================================================== */

.home-page .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-page .mock-test-feature {
    position: relative;
    border-color: #cfe5d7;
    background: linear-gradient(145deg, #ffffff, #f0f8f3);
}

.home-page .mock-test-feature:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.mock-test-label {
    display: inline-flex;
    align-self: flex-start;
    margin: -7px 0 10px;
    padding: 4px 9px;
    border-radius: 20px;
    background: #eaf5ef;
    color: #176b55;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

/* Mock tests page layout */

.quiz-page .main-container {
    width: min(1100px, 90%);
    margin: 38px auto 65px;
}

.quiz-page .features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    margin-top: 24px;
}

.quiz-page .feature-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.quiz-page .feature-card:hover {
    transform: translateY(-3px);
    border-color: #bad9c6;
    box-shadow: var(--shadow-md);
}

.quiz-page .feature-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 17px;
    border: 1px solid #d7eadf;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.quiz-page .feature-card h2,
.quiz-page .feature-card h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 19px;
    line-height: 1.45;
}

.quiz-page .feature-card p {
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

/* Form fields */

.quiz-page .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-page .form-group label {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.quiz-page .form-group select {
    width: 100%;
    min-height: 47px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    outline-offset: 2px;
}

.quiz-page .form-group select:focus {
    border-color: var(--primary);
}

.quiz-page .form-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.quiz-page .feature-card form {
    width: 100%;
    margin-top: auto;
}

.quiz-page .feature-card form .primary-btn {
    width: 100%;
    margin-top: 12px;
}

/* Main mock-test form button */

.quiz-page .feature-card > .quiz-form .primary-btn {
    width: 100%;
}

/* Quiz info section */

.quiz-page .quiz-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 23px;
    padding: 23px 25px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.quiz-page .quiz-info h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}

.quiz-page .quiz-info p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.quiz-page .question-title {
    flex: 1;
    min-width: 0;
}

.quiz-page .question-title h3 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    line-height: 1.65;
}

.quiz-page .submit-area {
    margin-top: 27px;
    padding: 27px;
    border: 1px solid #d7e8de;
    border-radius: 17px;
    background: linear-gradient(120deg, #ffffff, #edf7f0);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.quiz-page .submit-area h3 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
}

.quiz-page .submit-area p {
    margin: 7px 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.quiz-page .empty-state {
    padding: 42px 25px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.quiz-page .empty-state h2 {
    color: var(--text);
    font-size: 24px;
}

.quiz-page .empty-state p {
    margin: 10px auto 23px;
    color: var(--muted);
    line-height: 1.8;
}

/* Responsive layout */

@media (max-width: 900px) {
    .home-page .features-grid,
    .quiz-page .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .home-page .features-grid,
    .quiz-page .features-grid {
        grid-template-columns: 1fr;
    }

    .quiz-page .main-container {
        width: 92%;
        margin-top: 25px;
    }

    .quiz-page .feature-card {
        padding: 20px;
    }

    .quiz-page .quiz-info {
        align-items: flex-start;
        flex-direction: column;
        padding: 19px;
    }

    .quiz-page .submit-area {
        padding: 22px 17px;
    }

    .quiz-page .submit-area .primary-btn {
        width: 100%;
    }
}

/* =========================================
   NEWS DASHBOARD — LAYOUT FIX
   Applies only to news.html
========================================= */

.news-page {
    min-height: 100vh;
    background: #f5f8f6;
    color: #172b25;
}

/* Main navigation */

.news-page .navbar {
    width: 100%;
    padding: 15px clamp(16px, 5vw, 72px);
    gap: 16px;
}

.news-page .nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

/* Hero section */

.news-page .news-hero {
    width: 100%;
    margin: 0;
    padding: clamp(44px, 7vw, 82px) 5%;
    background: linear-gradient(
        125deg,
        #e5f3e9 0%,
        #f8fbf9 65%,
        #edf6f0 100%
    );
    border-bottom: 1px solid #dce9df;
}

.news-page .news-hero-content {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
}

.news-page .news-hero h1 {
    margin: 15px 0;
    color: #17372a;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -1px;
    overflow-wrap: anywhere;
}

.news-page .news-hero p {
    max-width: 720px;
    margin: 0;
    color: #627568;
    font-size: 16px;
    line-height: 1.85;
}

/* Hero buttons: matches news.html */

.news-page .hero-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.news-page .hero-buttons .primary-btn,
.news-page .hero-buttons .secondary-btn {
    min-height: 46px;
    max-width: 100%;
}

/* Main dashboard container */

.news-page .main-container {
    width: min(1160px, 90%);
    max-width: 1160px;
    margin: 40px auto 65px;
    padding: 0;
    flex: 1 0 auto;
}

/* Flash and error messages */

.news-page .flash-message {
    margin: 0 0 16px;
    padding: 13px 16px;
    border-radius: 11px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.news-page .notice {
    margin: 18px 0;
    padding: 15px 18px;
    border: 1px solid #e2e9e5;
    border-radius: 12px;
    background: #ffffff;
    overflow-wrap: anywhere;
}

.news-page .notice.error {
    border-color: #f0cdca;
    background: #fff1f0;
    color: #ad3939;
}

/* Audio panel */

.news-page .audio-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px;
    width: 100%;
    margin: 0 0 45px;
    padding: clamp(22px, 4vw, 32px);
    border: 0;
    border-radius: 20px;
    background: linear-gradient(125deg, #104c3e, #176b55);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 76, 62, 0.12);
}

.news-page .audio-copy {
    flex: 1 1 260px;
    min-width: 0;
}

.news-page .audio-copy h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(21px, 3vw, 26px);
    line-height: 1.4;
}

.news-page .audio-copy p {
    margin: 8px 0 0;
    color: #e0eee7;
    font-size: 14px;
    line-height: 1.8;
}

.news-page .audio-form {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
}

.news-page .audio-form .primary-btn {
    border-color: #ffffff;
    background: #ffffff;
    color: #104c3e;
    box-shadow: none;
}

.news-page .audio-form .primary-btn:hover {
    border-color: #e2f1e7;
    background: #e2f1e7;
    color: #104c3e;
}

/* Generated audio player */

.news-page .audio-player-wrap {
    flex: 1 0 100%;
    min-width: 0;
    margin-top: 2px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.10);
}

.news-page .audio-player-wrap p {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.news-page .audio-player-wrap audio {
    display: block;
    width: 100%;
    max-width: 700px;
}

/* Section heading */

.news-page .section-heading {
    width: 100%;
    margin: 0 0 25px;
    text-align: left;
}

.news-page .section-heading h2 {
    margin: 8px 0 6px;
    color: #172b25;
    font-size: clamp(25px, 3vw, 33px);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.5px;
}

.news-page .section-heading p {
    margin: 0;
    color: #687770;
    font-size: 14px;
    line-height: 1.8;
}

/* News cards grid */

.news-page .news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    width: 100%;
    margin: 0 0 38px;
}

.news-page .news-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 275px;
    padding: 23px;
    border: 1px solid #e2e9e5;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(20, 65, 47, 0.045);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.news-page .news-card:hover {
    transform: translateY(-3px);
    border-color: #b9d7c5;
    box-shadow: 0 12px 30px rgba(20, 65, 47, 0.075);
}

/* Category and source */

.news-page .news-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 6px;
}

.news-page .news-category {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid #dcece1;
    border-radius: 30px;
    background: #eaf5ef;
    color: #176b55;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.news-page .news-source {
    display: inline-block;
    color: #687770;
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* News title and description */

.news-page .news-card h3 {
    margin: 12px 0 10px;
    color: #172b25;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.news-page .news-card p {
    margin: 0 0 14px;
    color: #687770;
    font-size: 13px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

/* Date and read-more link */

.news-page .news-date {
    display: block;
    margin: auto 0 0;
    padding-top: 12px;
    color: #7b8981;
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.news-page .feature-link {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding-top: 15px;
    color: #176b55;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.news-page .feature-link:hover {
    color: #104c3e;
    text-decoration: underline;
}

/* Empty state */

.news-page .empty-state {
    margin: 20px 0 35px;
    padding: clamp(25px, 4vw, 40px);
    border: 1px dashed #cbdcd2;
    border-radius: 17px;
    background: #ffffff;
    text-align: center;
}

.news-page .empty-state h3 {
    margin: 0 0 8px;
    color: #172b25;
    font-size: 21px;
    line-height: 1.45;
}

.news-page .empty-state p {
    margin: 0 0 20px;
    color: #687770;
    font-size: 14px;
    line-height: 1.8;
}

/* Quiz CTA */

.news-page .account-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin: 35px 0 0;
    padding: clamp(22px, 4vw, 30px);
    border: 1px solid #d8e8de;
    border-radius: 18px;
    background: linear-gradient(125deg, #edf7f0, #ffffff);
    box-shadow: 0 4px 16px rgba(20, 65, 47, 0.04);
}

.news-page .account-cta > div {
    flex: 1 1 280px;
    min-width: 0;
}

.news-page .account-cta h2 {
    margin: 0 0 8px;
    color: #172b25;
    font-size: 22px;
    line-height: 1.4;
}

.news-page .account-cta p {
    margin: 0;
    color: #687770;
    font-size: 14px;
    line-height: 1.8;
}

.news-page .account-cta .primary-btn {
    flex-shrink: 0;
}

/* Footer */

.news-page .footer {
    margin-top: auto;
}

/* Tablet */

@media (max-width: 950px) {
    .news-page .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .news-page .main-container {
        width: 92%;
    }
}

/* Mobile */

@media (max-width: 620px) {
    .news-page .navbar {
        align-items: flex-start;
        padding: 13px 5%;
    }

    .news-page .brand {
        font-size: 15px;
        gap: 9px;
    }

    .news-page .brand-icon {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .news-page .nav-links {
        justify-content: flex-start;
        width: 100%;
        gap: 5px;
    }

    .news-page .nav-link {
        padding: 7px 9px;
        font-size: 12px;
    }

    .news-page .news-hero {
        padding: 42px 5%;
    }

    .news-page .news-hero p {
        font-size: 14px;
    }

    .news-page .hero-buttons {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .news-page .hero-buttons a {
        width: 100%;
    }

    .news-page .main-container {
        width: 90%;
        margin-top: 28px;
        margin-bottom: 42px;
    }

    .news-page .audio-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 32px;
        padding: 21px;
        border-radius: 16px;
    }

    .news-page .audio-form,
    .news-page .audio-form button {
        width: 100%;
    }

    .news-page .news-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .news-page .news-card {
        min-height: 0;
        padding: 20px;
    }

    .news-page .account-cta {
        align-items: stretch;
        flex-direction: column;
        gap: 17px;
        padding: 22px;
    }

    .news-page .account-cta .primary-btn {
        width: 100%;
    }
}

/* Exam relevance badges */
.news-page .exam-relevance-row {
    margin: 7px 0 2px;
}

.news-page .exam-relevance-badge {
    display: inline-flex;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.5;
}

.news-page .relevance-high {
    border-color: #c7e6d2;
    background: #e7f6ec;
    color: #176b43;
}

.news-page .relevance-medium {
    border-color: #eadbb6;
    background: #fff7e4;
    color: #805b13;
}

.news-page .relevance-reason {
    display: grid;
    gap: 4px;
    margin: 12px 0 14px;
    padding: 11px 12px;
    border-left: 3px solid #b8d9c4;
    border-radius: 0 9px 9px 0;
    background: #f4f9f5;
    color: #5b6e62;
    font-size: 12px;
    line-height: 1.7;
}

.news-page .relevance-reason strong {
    color: #176b55;
    font-size: 11px;
}
header.quiz-hero {
    margin: 20px 89px;
}

/* =============================================================
   8. MOBILE-FIRST RESPONSIVE REFINEMENTS
   Appends to the existing stylesheet without changing its theme.
   Optimised for small phones (320px+), large phones, tablets and
   landscape orientation. Keep this block at the VERY END of style.css.
============================================================= */

:root {
    --mobile-gutter: clamp(14px, 4.2vw, 24px);
    --mobile-card-radius: 15px;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

img,
video,
iframe,
canvas,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea,
a {
    touch-action: manipulation;
}

/* Let long Hindi/English text wrap instead of widening the page. */
.home-page,
.news-page,
.quiz-page,
.result-page,
.history-page,
.auth-page,
.home-page main,
.news-page main,
.quiz-page main,
.result-page main,
.history-page main,
.auth-page main,
.feature-card,
.news-card,
.question-card,
.answer-card,
.history-panel,
.auth-card {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Tablet and small laptop layout. */
@media (max-width: 1000px) {
    .home-page .features-grid,
    .quiz-page .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-page .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-page .language-section {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 22px;
    }

    .result-page .result-summary-card {
        grid-template-columns: 155px minmax(0, 1fr);
        gap: 22px;
        padding: 24px;
    }

    .result-page .score-circle {
        width: 145px;
        height: 145px;
    }
}

/* Main mobile layout. */
@media (max-width: 760px) {
    body {
        font-size: 14px;
        line-height: 1.65;
    }

    .navbar,
    .home-page .navbar,
    .news-page .navbar,
    .quiz-page .navbar,
    .auth-page .navbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 11px;
        min-height: 0;
        padding: 12px var(--mobile-gutter);
    }

    .brand {
        align-self: flex-start;
        max-width: 100%;
        gap: 9px;
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .brand-icon {
        width: 38px;
        min-width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .nav-links,
    .news-page .nav-links,
    .quiz-page .navbar .nav-links {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        min-width: 0;
    }

    .nav-link,
    .back-link {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 12px;
        white-space: normal;
    }

    .nav-signup,
    .logout-btn {
        min-height: 40px;
        padding: 8px 12px;
    }

    .welcome-user {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .logout-form {
        width: auto;
        max-width: 100%;
    }

    .home-page .hero,
    .news-page .news-hero,
    .quiz-page .quiz-hero,
    .result-page .result-hero,
    .history-page .history-hero {
        padding: clamp(30px, 7vw, 46px) var(--mobile-gutter);
    }

    /* Fix the old fixed 89px side margins on quiz hero headers. */
    header.quiz-hero {
        width: calc(100% - (2 * var(--mobile-gutter)));
        max-width: var(--content-width);
        margin: 14px auto;
    }

    .home-page .hero h1 {
        max-width: 100%;
        font-size: clamp(32px, 7.5vw, 46px);
        line-height: 1.12;
        letter-spacing: -0.8px;
        overflow-wrap: anywhere;
    }

    .news-page .news-hero h1,
    .quiz-page .quiz-hero h1,
    .result-page .result-hero h1,
    .history-page .history-hero h1 {
        max-width: 100%;
        font-size: clamp(29px, 6.7vw, 42px);
        line-height: 1.18;
        letter-spacing: -0.5px;
        overflow-wrap: anywhere;
    }

    .home-page .hero-content > p,
    .news-page .news-hero p,
    .quiz-page .quiz-hero p,
    .result-page .result-hero p,
    .history-page .history-hero p {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.75;
    }

    .home-page .hero-buttons,
    .news-page .hero-buttons,
    .news-page .news-hero-actions {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .home-page .hero-buttons > *,
    .news-page .hero-buttons > *,
    .news-page .news-hero-actions > * {
        width: 100%;
        max-width: 100%;
    }

    .primary-btn,
    .secondary-btn {
        min-height: 44px;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .home-page .main-container,
    .news-page .news-container,
    .news-page .main-container,
    .quiz-page .quiz-container,
    .quiz-page .main-container,
    .result-page .result-container,
    .history-page .history-container {
        width: calc(100% - (2 * var(--mobile-gutter)));
        max-width: 100%;
        margin: 25px auto 40px;
    }

    .messages-container,
    .quiz-page .messages-container {
        width: calc(100% - (2 * var(--mobile-gutter)));
        max-width: 100%;
    }

    .home-page .features-grid,
    .quiz-page .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    .home-page .feature-card,
    .quiz-page .feature-card {
        min-height: 0;
        padding: 18px;
        border-radius: var(--mobile-card-radius);
    }

    .home-page .feature-card h3,
    .quiz-page .feature-card h2,
    .quiz-page .feature-card h3 {
        font-size: 16px;
        line-height: 1.45;
    }

    .home-page .feature-card p,
    .quiz-page .feature-card p {
        font-size: 13px;
        line-height: 1.7;
    }

    .home-page .feature-icon,
    .quiz-page .feature-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 13px;
    }

    .home-page .section-heading h2,
    .news-page .section-heading h2 {
        font-size: clamp(23px, 5.5vw, 30px);
        line-height: 1.3;
    }

    .home-page .language-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        margin-top: 25px;
        padding: 20px;
        border-radius: 17px;
    }

    .home-page .language-buttons {
        min-width: 0;
    }

    .home-page .language-card {
        min-width: 0;
        padding: 13px;
        gap: 11px;
    }

    .home-page .language-code {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }

    .home-page .account-cta,
    .news-page .news-quiz-cta,
    .news-page .account-cta,
    .history-page .history-bottom-cta,
    .result-page .result-bottom-cta {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .home-page .account-cta .primary-btn,
    .news-page .news-quiz-cta .primary-btn,
    .news-page .account-cta .primary-btn,
    .history-page .history-bottom-cta .secondary-btn,
    .result-page .result-bottom-cta .primary-btn {
        width: 100%;
    }

    /* News and audio cards. */
    .news-page .audio-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 28px;
        padding: 18px;
        border-radius: 16px;
    }

    .news-page .audio-panel-heading {
        display: flex;
        flex: 1 1 auto;
        align-items: flex-start;
        gap: 11px;
        width: 100%;
    }

    .news-page .audio-icon {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        flex: 0 0 44px;
        font-size: 22px;
    }

    .news-page .audio-panel-heading h2,
    .news-page .audio-copy h2 {
        font-size: 19px;
        line-height: 1.4;
    }

    .news-page .audio-panel-heading p,
    .news-page .audio-copy p {
        font-size: 13px;
        line-height: 1.7;
    }

    .news-page .audio-form,
    .news-page .audio-form button,
    .news-page .audio-form .primary-btn,
    .news-page .audio-generate-btn {
        width: 100%;
        max-width: 100%;
    }

    .news-page .audio-player,
    .news-page .audio-player-wrap {
        width: 100%;
        min-width: 0;
    }

    .news-page .audio-player audio,
    .news-page .audio-player-wrap audio {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .news-page .news-list-heading,
    .news-page .section-heading,
    .result-page .review-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .news-page .news-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
    }

    .news-page .news-card {
        min-height: 0;
        padding: 17px;
        border-radius: var(--mobile-card-radius);
    }

    .news-page .news-card h3 {
        margin-top: 12px;
        font-size: 16px;
        line-height: 1.55;
    }

    .news-page .news-card p,
    .news-page .news-description {
        font-size: 13px;
        line-height: 1.75;
    }

    .news-page .news-card-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .news-page .news-meta,
    .news-page .news-metadata {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .news-page .read-source-link,
    .news-page .feature-link {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
    }

    /* Quiz and mock-test controls. */
    .quiz-page .quiz-info-card,
    .quiz-page .quiz-info {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 18px;
    }

    .quiz-page .quiz-count,
    .quiz-page .quiz-info-card .quiz-count {
        white-space: normal;
    }

    .quiz-page .question-card {
        padding: 17px;
        border-radius: 15px;
    }

    .quiz-page .question-header {
        gap: 10px;
    }

    .quiz-page .question-number {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .quiz-page .question-heading h3,
    .quiz-page .question-title h3 {
        font-size: 15px;
        line-height: 1.65;
        overflow-wrap: anywhere;
    }

    .quiz-page .options-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .quiz-page .option-label {
        align-items: flex-start;
        min-height: 52px;
        gap: 9px;
        padding: 12px;
    }

    .quiz-page .option-label input[type="radio"],
    .quiz-page .option-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 3px;
        flex: 0 0 18px;
    }

    .quiz-page .option-letter {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
        flex-shrink: 0;
    }

    .quiz-page .option-text {
        font-size: 13px;
        line-height: 1.65;
        overflow-wrap: anywhere;
    }

    .quiz-page .quiz-submit-card,
    .quiz-page .submit-area {
        padding: 21px 16px;
    }

    .quiz-page .quiz-submit-btn,
    .quiz-page .submit-area .primary-btn {
        width: 100%;
        min-height: 46px;
    }

    .quiz-page .form-group select,
    .quiz-page input,
    .quiz-page select,
    .quiz-page textarea,
    .auth-page input,
    .auth-page select,
    .auth-page textarea {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    /* 16px form text prevents unwanted iOS zoom on input focus. */
    .auth-page .auth-container {
        align-items: flex-start;
        padding: 24px var(--mobile-gutter);
    }

    .auth-page .auth-card {
        width: 100%;
        max-width: 465px;
        margin: 0 auto;
        padding: 23px 18px;
        border-radius: 17px;
    }

    .auth-page .auth-heading {
        margin-bottom: 22px;
    }

    .auth-page .auth-heading h1 {
        font-size: 24px;
    }

    .auth-page .auth-form {
        gap: 15px;
    }

    .auth-page .auth-button {
        min-height: 48px;
        width: 100%;
    }

    /* Results: prevent score cards and answer details overflowing. */
    .result-page .result-summary-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 20px 16px;
        text-align: center;
    }

    .result-page .score-circle {
        width: 135px;
        height: 135px;
        border-width: 7px;
    }

    .result-page .score-circle strong {
        font-size: 30px;
    }

    .result-page .score-details {
        width: 100%;
    }

    .result-page .score-details h2 {
        font-size: 23px;
    }

    .result-page .score-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        text-align: left;
    }

    .result-page .score-stat {
        padding: 10px 9px;
    }

    .result-page .score-stat .stat-label {
        font-size: 10px;
        overflow-wrap: anywhere;
    }

    .result-page .score-stat strong {
        font-size: 21px;
    }

    .result-page .result-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }

    .result-page .result-actions > a,
    .result-page .result-actions button {
        width: 100%;
        max-width: 100%;
    }

    .result-page .answer-card {
        padding: 16px;
        border-radius: 14px;
    }

    .result-page .answer-question {
        font-size: 15px;
        line-height: 1.65;
    }

    .result-page .answer-detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .result-page .answer-detail p {
        font-size: 13px;
    }

    /* History: cards stack; table can scroll inside its own wrapper. */
    .history-page .history-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .history-page .history-stat-card {
        padding: 15px;
    }

    .history-page .history-panel {
        max-width: 100%;
    }

    .history-page .history-table-wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .history-page .history-table {
        min-width: 620px;
    }

    .history-page .history-panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 17px;
    }

    .history-page .history-panel-heading .primary-btn {
        width: 100%;
    }

    .history-page .history-bottom-cta .secondary-btn {
        width: 100%;
    }

    .footer {
        padding: 22px var(--mobile-gutter);
    }

    .footer-links {
        gap: 8px 14px;
    }

    .footer-links a,
    .footer > a {
        display: inline-flex;
        align-items: center;
        min-height: 35px;
    }
}

/* Narrow phones: 320px–390px, including compact Android and iPhones. */
@media (max-width: 390px) {
    :root {
        --mobile-gutter: 13px;
    }

    .brand {
        font-size: 15px;
    }

    .nav-link,
    .back-link,
    .nav-signup,
    .logout-btn {
        padding: 7px 9px;
        font-size: 11px;
    }

    .home-page .hero h1 {
        font-size: clamp(29px, 8.1vw, 34px);
        letter-spacing: -0.5px;
    }

    .news-page .news-hero h1,
    .quiz-page .quiz-hero h1,
    .result-page .result-hero h1,
    .history-page .history-hero h1 {
        font-size: clamp(27px, 7.2vw, 31px);
        letter-spacing: -0.3px;
    }

    .home-page .features-grid,
    .quiz-page .features-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-page .feature-card,
    .quiz-page .feature-card {
        padding: 17px;
    }

    .home-page .section-heading h2,
    .news-page .section-heading h2 {
        font-size: 23px;
    }

    .news-page .news-card {
        padding: 15px;
    }

    .result-page .score-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .result-page .score-stat {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .result-page .score-stat strong {
        margin-top: 0;
        font-size: 20px;
    }

    .history-page .history-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-page .auth-card {
        padding: 21px 15px;
    }
}

/* Very short screens and landscape phones: avoid oversized vertical gaps. */
@media (max-height: 500px) and (orientation: landscape) {
    .home-page .hero,
    .news-page .news-hero,
    .quiz-page .quiz-hero,
    .result-page .result-hero,
    .history-page .history-hero {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .auth-page .auth-container {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

/* Accessibility: preserve readable controls and remove motion where requested. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* =====================================================================
   PREMIUM EDITORIAL DESIGN LAYER — Daily Current Affairs
   Keeps existing template class names and functionality intact.
   Additive overrides: place at the bottom of style.css.
   Visual direction: luxury editorial / forest green / warm ivory / brass.
===================================================================== */

:root {
    --primary: #145846;
    --primary-dark: #0d4133;
    --primary-deep: #082d24;
    --primary-soft: #e7f2eb;
    --primary-pale: #f4f8f4;
    --background: #f6f7f2;
    --surface: #ffffff;
    --text: #15251f;
    --muted: #68776f;
    --border: #e1e8e1;
    --border-strong: #cbd8ce;
    --danger: #a83333;
    --danger-bg: #fff0ef;
    --success: #176744;
    --success-bg: #e8f5ec;
    --accent: #c5a15e;
    --accent-soft: #f6efdf;
    --shadow-sm: 0 7px 22px rgba(19, 49, 36, .055);
    --shadow-md: 0 18px 42px rgba(19, 49, 36, .095);
    --shadow-lg: 0 28px 70px rgba(8, 45, 36, .15);
    --radius-sm: 11px;
    --radius-md: 17px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --content-width: 1200px;
}

html { scroll-padding-top: 92px; }
body {
    color: var(--text);
    background-color: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -.01em;
}

::selection { color: #fff; background: #276c53; }
:focus-visible { outline-color: rgba(197, 161, 94, .7); }

/* Shared premium navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 78px;
    padding: 14px clamp(18px, 5.5vw, 78px);
    background: rgba(255, 255, 255, .91);
    border-bottom: 1px solid rgba(211, 224, 214, .85);
    box-shadow: 0 8px 28px rgba(21, 53, 38, .035);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.brand {
    gap: 13px;
    color: #13281f;
    font-size: 17px;
    font-weight: 850;
    letter-spacing: -.035em;
}
.brand-icon {
    width: 45px;
    min-width: 45px;
    height: 45px;
    border: 1px solid rgba(225, 199, 139, .62);
    border-radius: 14px;
    background: linear-gradient(145deg, #1b7055 0%, #0b3d30 78%);
    color: #fff9eb;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px rgba(11,61,48,.18);
    letter-spacing: .04em;
}
.nav-links { gap: 7px; }
.nav-link, .back-link {
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #4f6258;
    font-size: 12px;
    font-weight: 750;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.nav-link:hover, .back-link:hover {
    border-color: #dce8dd;
    background: #f0f6f0;
    color: var(--primary-dark);
}
.nav-signup, .logout-btn {
    min-height: 41px;
    padding: 9px 15px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
}
.nav-signup {
    border-color: var(--primary-dark);
    background: linear-gradient(135deg, #1b7055, #0d4133);
    box-shadow: 0 7px 17px rgba(13,65,51,.17);
}
.nav-signup:hover { background: #082d24; box-shadow: 0 10px 22px rgba(13,65,51,.22); }
.logout-btn { border-color: #d4dfd5; background: #fff; color: #244b3b; }
.welcome-user { color: #5c7064; font-size: 12px; }

/* Shared actions and controls */
.primary-btn, .secondary-btn, .auth-page .auth-button,
.quiz-page .quiz-submit-btn {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: -.01em;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.primary-btn, .auth-page .auth-button, .quiz-page .quiz-submit-btn {
    border-color: #0d4133;
    background: linear-gradient(135deg, #1d7457 0%, #0d4133 82%);
    color: #fff;
    box-shadow: 0 9px 20px rgba(13,65,51,.16), inset 0 1px 0 rgba(255,255,255,.16);
}
.primary-btn:hover, .auth-page .auth-button:hover, .quiz-page .quiz-submit-btn:hover {
    transform: translateY(-2px);
    border-color: #062b22;
    background: linear-gradient(135deg, #176149, #082d24);
    box-shadow: 0 14px 28px rgba(13,65,51,.23);
}
.secondary-btn {
    border-color: #d7e2d7;
    background: rgba(255,255,255,.92);
    color: #234c3b;
    box-shadow: 0 4px 12px rgba(19,49,36,.035);
}
.secondary-btn:hover { border-color: #c9ab70; background: #fffaf0; color: #173e30; }
button, input, select, textarea { accent-color: var(--primary); }
input, select, textarea {
    border-radius: 12px;
}
input:focus, select:focus, textarea:focus {
    border-color: #58947a !important;
    box-shadow: 0 0 0 4px rgba(35, 111, 80, .11) !important;
}
.section-label {
    color: #9b783b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.8px;
}
.flash-message {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(20,65,47,.025);
}
.footer {
    border-top: 1px solid #dfe7de;
    background: linear-gradient(180deg, #fff, #f8faf6);
}
.footer .brand-icon { box-shadow: none; }

/* Homepage — elevated editorial hero and feature collection */
.home-page {
    background: radial-gradient(ellipse at 85% 3%, rgba(206, 187, 139, .11), transparent 28%), #f6f7f2;
}
.home-page .hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(70px, 9vw, 122px) clamp(22px, 7vw, 100px);
    border: 0;
    background:
        radial-gradient(circle at 83% 18%, rgba(206, 173, 108, .18), transparent 25%),
        radial-gradient(circle at 100% 100%, rgba(64, 129, 93, .20), transparent 34%),
        linear-gradient(120deg, #082f25 0%, #0d4333 52%, #174f3c 100%);
    color: #f8f6ec;
}
.home-page .hero::before {
    position: absolute;
    z-index: -1;
    right: -7%;
    bottom: -55%;
    width: min(56vw, 680px);
    aspect-ratio: 1;
    border: 1px solid rgba(232, 207, 152, .18);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(232,207,152,.035), 0 0 0 70px rgba(232,207,152,.026), 0 0 0 125px rgba(232,207,152,.018);
    content: "";
    pointer-events: none;
}
.home-page .hero::after {
    top: auto;
    right: 10%;
    bottom: 12%;
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 10px rgba(197,161,94,.09), 0 0 26px rgba(197,161,94,.5);
}
.home-page .hero h1 {
    max-width: 880px;
    color: #fffdf5;
    font-size: clamp(42px, 6.3vw, 76px);
    line-height: 1.03;
    letter-spacing: -.065em;
    font-weight: 850;
}
.home-page .hero h1 span { color: #dfc78d; }
.home-page .hero-content > p { color: #d0ded4; max-width: 700px; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.9; }
.home-page .hero-badge {
    border-color: rgba(220,196,140,.35);
    background: rgba(255,255,255,.07);
    color: #e9d8aa;
    letter-spacing: 1.15px;
    backdrop-filter: blur(10px);
}
.home-page .hero-buttons { gap: 13px; }
.home-page .hero-buttons .primary-btn { border-color: #d6b66f; background: linear-gradient(135deg, #dfc27e, #b9934c); color: #152e23; box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.home-page .hero-buttons .primary-btn:hover { background: linear-gradient(135deg, #ecd493, #c5a15e); }
.home-page .hero-buttons .secondary-btn { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); color: #fffdf5; box-shadow: none; backdrop-filter: blur(8px); }
.home-page .hero-buttons .secondary-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.45); }
.home-page .user-welcome { color: #e7d39f !important; }
.home-page .main-container { width: min(var(--content-width), 90%); margin-top: 66px; margin-bottom: 82px; }
.home-page .section-heading h2, .news-page .section-heading h2 { letter-spacing: -.045em; font-weight: 850; }
.home-page .feature-card, .quiz-page .feature-card {
    position: relative;
    overflow: hidden;
    border-color: #e0e7de;
    border-radius: 21px;
    background: linear-gradient(155deg, #fff 0%, #fdfefb 70%, #f5f8f2 100%);
    box-shadow: 0 8px 24px rgba(19,49,36,.045), inset 0 1px 0 #fff;
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.home-page .feature-card::before, .quiz-page .feature-card::before {
    position: absolute;
    top: 0; left: 22px; right: 22px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(197,161,94,.7), transparent);
    content: "";
    opacity: .68;
}
.home-page .feature-card:hover, .quiz-page .feature-card:hover {
    transform: translateY(-6px);
    border-color: #cbb37e;
    box-shadow: 0 22px 42px rgba(19,49,36,.105);
}
.home-page .feature-icon, .quiz-page .feature-icon {
    border-color: #e7dcbf;
    border-radius: 15px;
    background: linear-gradient(145deg, #f8f1df, #eaf3e9);
    color: #176047;
}
.home-page .feature-card h3, .quiz-page .feature-card h2, .quiz-page .feature-card h3 { letter-spacing: -.025em; }
.home-page .feature-link, .news-page .feature-link { color: #176047; }
.home-page .language-section {
    border-color: #dce5d8;
    border-radius: 26px;
    background: radial-gradient(circle at 90% 0%, rgba(197,161,94,.12), transparent 33%), linear-gradient(125deg, #edf4e9, #fff 76%);
    box-shadow: inset 0 1px 0 #fff, 0 12px 34px rgba(19,49,36,.04);
}
.home-page .language-card { border-radius: 16px; }
.home-page .language-card:hover { border-color: #cbb37e; box-shadow: 0 12px 26px rgba(19,49,36,.07); }
.home-page .language-code { background: #0f4938; color: #f4e3b9; }
.home-page .account-cta, .news-page .news-quiz-cta, .news-page .account-cta,
.result-page .result-bottom-cta, .history-page .history-bottom-cta {
    border: 1px solid rgba(213,190,137,.42);
    border-radius: 22px;
    background: radial-gradient(circle at 95% 8%, rgba(197,161,94,.18), transparent 28%), linear-gradient(120deg, #0a362b, #124a37);
    color: #fffdf5;
    box-shadow: 0 18px 38px rgba(8,45,36,.11);
}
.home-page .account-cta h2, .news-page .news-quiz-cta h2, .news-page .account-cta h2,
.result-page .result-bottom-cta h2, .history-page .history-bottom-cta h2 { color: #fffdf5; }
.home-page .account-cta p, .news-page .news-quiz-cta p, .news-page .account-cta p,
.result-page .result-bottom-cta p, .history-page .history-bottom-cta p { color: #d1e0d5; }
.home-page .account-cta .primary-btn, .news-page .news-quiz-cta .primary-btn,
.news-page .account-cta .primary-btn, .result-page .result-bottom-cta .primary-btn,
.history-page .history-bottom-cta .primary-btn {
    border-color: #d9bd7c;
    background: linear-gradient(135deg, #e6cc8f, #bd984f);
    color: #17392b;
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

/* News page — confident editorial masthead, rich audio feature, refined cards */
.news-page { background: #f6f7f2; }
.news-page .news-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 7vw, 88px) clamp(22px, 7vw, 100px);
    border: 0;
    background:
        radial-gradient(circle at 86% 16%, rgba(197,161,94,.18), transparent 24%),
        linear-gradient(120deg, #082f25, #0e4433 63%, #174f3c);
}
.news-page .news-hero::after {
    position: absolute;
    top: -90px; right: -30px;
    width: 290px; height: 290px;
    border: 1px solid rgba(236,211,158,.15);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(236,211,158,.03), 0 0 0 76px rgba(236,211,158,.025);
    content: "";
    pointer-events: none;
}
.news-page .news-hero h1 { position: relative; z-index: 1; color: #fffdf5; font-size: clamp(38px,5.2vw,64px); letter-spacing: -.06em; font-weight: 850; }
.news-page .news-hero p { position: relative; z-index: 1; color: #d4e0d6; }
.news-page .news-hero .section-label { color: #e1c788; }
.news-page .news-hero-actions .primary-btn { border-color: #dfc27e; background: linear-gradient(135deg,#dfc27e,#b9934c); color: #17392b; }
.news-page .main-container, .news-page .news-container { width: min(var(--content-width), 90%); margin-top: 42px; margin-bottom: 76px; }
.news-page .audio-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(25px,4vw,38px);
    border: 1px solid rgba(222,194,129,.25);
    border-radius: 24px;
    background: radial-gradient(circle at 90% 0%, rgba(197,161,94,.18), transparent 32%), linear-gradient(120deg,#082f25,#104a37 70%,#18533e);
    box-shadow: 0 22px 45px rgba(8,45,36,.17);
}
.news-page .audio-panel::after {
    position: absolute; right: 9%; bottom: -75px;
    width: 210px; height: 210px;
    border: 1px solid rgba(237,214,166,.17); border-radius: 50%;
    box-shadow: 0 0 0 24px rgba(237,214,166,.025), 0 0 0 58px rgba(237,214,166,.02);
    content: ""; pointer-events: none;
}
.news-page .audio-copy h2, .news-page .audio-panel-heading h2 { color: #fffdf5; font-size: clamp(22px,2.8vw,29px); letter-spacing: -.035em; }
.news-page .audio-copy p, .news-page .audio-panel-heading p { color: #d5e3d9; }
.news-page .audio-form .primary-btn, .news-page .audio-generate-btn { position: relative; z-index: 1; border-color: #e3cd96; background: linear-gradient(135deg,#fffdf5,#f5ead0); color: #173f2f; box-shadow: 0 8px 19px rgba(0,0,0,.10); }
.news-page .audio-player-wrap, .news-page .audio-player { position: relative; z-index: 1; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.09); backdrop-filter: blur(8px); }
.news-page .news-grid { gap: 21px; }
.news-page .news-card {
    position: relative;
    overflow: hidden;
    border-color: #e0e7de;
    border-radius: 20px;
    background: linear-gradient(155deg,#fff 0%,#fff 68%,#f7f9f4 100%);
    box-shadow: 0 8px 24px rgba(19,49,36,.045);
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.news-page .news-card::before { position: absolute; top: 0; left: 22px; right: 22px; height: 2px; background: linear-gradient(90deg,transparent,#c5a15e,transparent); content: ""; opacity: .72; }
.news-page .news-card:hover { transform: translateY(-5px); border-color: #cbb37e; box-shadow: 0 22px 40px rgba(19,49,36,.10); }
.news-page .news-category, .news-page .exam-relevance-badge { border-color: #e6ddc6; background: #f8f2e4; color: #80632f; }
.news-page .news-source, .news-page .news-date { color: #7a877d; }
.news-page .news-card h3 { color: #192a21; font-size: 17px; letter-spacing: -.025em; }
.news-page .news-card p { color: #617067; }
.news-page .news-card .feature-link, .news-page .read-source-link { color: #145846; }
.news-page .relevance-reason { border-left-color: #c5a15e; background: #f8f5eb; color: #6d6757; }
.news-page .relevance-reason strong { color: #805f2a; }
.news-page .empty-state, .news-page .news-empty-state { border-color: #e0e7de; border-style: solid; border-radius: 22px; box-shadow: var(--shadow-sm); }

/* Quiz and mock-test experiences */
.quiz-page { background: radial-gradient(ellipse at 100% 0%, rgba(197,161,94,.09), transparent 24%), #f6f7f2; }
.quiz-page .quiz-hero {
    position: relative; overflow: hidden;
    border: 0;
    background: radial-gradient(circle at 90% 8%, rgba(197,161,94,.15), transparent 24%), linear-gradient(120deg,#082f25,#104633 75%,#18513c);
}
.quiz-page .quiz-hero::after, .result-page .result-hero::after, .history-page .history-hero::after {
    position: absolute; top: -120px; right: -35px; width: 300px; height: 300px;
    border: 1px solid rgba(231,208,157,.15); border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(231,208,157,.025), 0 0 0 80px rgba(231,208,157,.02);
    content: ""; pointer-events: none;
}
.quiz-page .quiz-hero h1 { color: #fffdf5; letter-spacing: -.045em; }
.quiz-page .quiz-hero p { color: #d2dfd5; }
.quiz-page .quiz-hero .section-label { color: #e1c788; }
.quiz-page header.quiz-hero { margin: 0; }
.quiz-page .main-container, .quiz-page .quiz-container { width: min(1100px, 90%); }
.quiz-page .quiz-info, .quiz-page .quiz-info-card, .quiz-page .submit-area, .quiz-page .quiz-submit-card {
    border-color: #e0e7de; border-radius: 20px; background: linear-gradient(145deg,#fff,#fafbf7);
    box-shadow: 0 10px 28px rgba(19,49,36,.05), inset 0 1px 0 #fff;
}
.quiz-page .question-card {
    border-color: #e0e7de; border-radius: 21px; padding: clamp(20px,3vw,30px);
    background: linear-gradient(145deg,#fff,#fdfefb); box-shadow: 0 8px 24px rgba(19,49,36,.045);
}
.quiz-page .question-card:focus-within { border-color: #c5a15e; box-shadow: 0 16px 34px rgba(19,49,36,.08); }
.quiz-page .question-number { border-radius: 13px; background: linear-gradient(145deg,#1b7055,#0a392c); box-shadow: 0 7px 15px rgba(13,65,51,.16); }
.quiz-page .option-label { border-color: #e0e7de; border-radius: 14px; background: #fff; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.quiz-page .option-label:hover { transform: translateY(-1px); border-color: #cfb77f; background: #fffdf7; }
.quiz-page .option-label:has(input:checked) { border-color: #a88a4c; background: #f9f3e5; box-shadow: inset 0 0 0 1px rgba(197,161,94,.15); }
.quiz-page .option-letter { background: #eaf2e9; color: #145846; }
.quiz-page .option-label:has(input:checked) .option-letter { background: #145846; color: #fff; }
.quiz-page .question-summary { border-color: #e5ddc7; border-left-color: #c5a15e; border-radius: 13px; background: #faf7ed; color: #676250; }
.quiz-page .question-summary strong { color: #765a2a; }
.quiz-page .form-group select { border-color: #d9e3d8; border-radius: 12px; }
.quiz-page .form-hint { color: #718076; }
.quiz-page .submit-area, .quiz-page .quiz-submit-card { background: radial-gradient(circle at 90% 0%, rgba(197,161,94,.12), transparent 30%), linear-gradient(135deg,#fff,#f0f6ef); }
.quiz-page .quiz-count { border-color: #e6ddc6; background: #f8f2e4; color: #80632f; }

/* Score / result screen */
.result-page { background: #f6f7f2; }
.result-page .result-hero, .history-page .history-hero {
    position: relative; overflow: hidden; border: 0;
    background: radial-gradient(circle at 88% 8%, rgba(197,161,94,.14), transparent 25%), linear-gradient(120deg,#082f25,#104633 75%,#18513c);
}
.result-page .result-hero h1, .history-page .history-hero h1 { color: #fffdf5; letter-spacing: -.05em; }
.result-page .result-hero p, .history-page .history-hero p { color: #d2dfd5; }
.result-page .result-hero .section-label, .history-page .history-hero .section-label { color: #e1c788; }
.result-page .result-summary-card {
    border-color: #e0e7de; border-radius: 24px;
    background: radial-gradient(circle at 90% 0%,rgba(197,161,94,.12),transparent 28%),linear-gradient(135deg,#fff,#f2f7ef);
    box-shadow: 0 15px 36px rgba(19,49,36,.065);
}
.result-page .score-circle { border-color: #d8e7d7; background: linear-gradient(145deg,#fff,#f5f7ed); box-shadow: inset 0 0 0 1px #edf3e9, 0 12px 24px rgba(19,49,36,.075); }
.result-page .score-circle strong { color: #145846; }
.result-page .score-stat, .result-page .result-actions { border-color: #e0e7de; border-radius: 14px; box-shadow: 0 5px 15px rgba(19,49,36,.025); }
.result-page .answer-card { border-color: #e0e7de; border-radius: 19px; box-shadow: 0 8px 23px rgba(19,49,36,.04); }
.result-page .answer-card:has(.status-correct) { border-left-color: #2c805b; }
.result-page .answer-context, .result-page .answer-explanation { border-color: #e5ddc7; border-left-color: #c5a15e; border-radius: 13px; background: #faf7ed; color: #696452; }
.result-page .answer-context strong, .result-page .answer-explanation strong { color: #765a2a; }
.result-page .review-count { border-color: #e6ddc6; background: #f8f2e4; color: #80632f; }

/* History and analytics */
.history-page { background: #f6f7f2; }
.history-page .history-hero { padding: clamp(46px,6vw,78px) clamp(22px,7vw,100px); }
.history-page .history-panel, .history-page .history-stat-card, .history-page .history-table-wrapper,
.history-page .history-chart-card, .history-page .history-empty-state {
    border-color: #e0e7de; border-radius: 20px; background: linear-gradient(145deg,#fff,#fdfefb);
    box-shadow: 0 9px 27px rgba(19,49,36,.045);
}
.history-page .history-stat-card { position: relative; overflow: hidden; }
.history-page .history-stat-card::before { position:absolute;left:18px;right:18px;top:0;height:2px;background:linear-gradient(90deg,transparent,#c5a15e,transparent);content:""; }
.history-page .history-panel-heading { border-bottom-color: #e7ece4; }
.history-page .history-table { border-collapse: separate; border-spacing: 0; }
.history-page .history-table thead th { background: #edf3e9; color: #385547; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.history-page .history-table td, .history-page .history-table th { border-bottom-color: #e7ece4; }
.history-page .history-table tbody tr:hover { background: #f8f8f0; }
.history-page .history-bottom-cta { margin-top: 28px; }

/* Authentication — refined high-trust sign-in and signup forms */
.auth-page {
    background: radial-gradient(ellipse at 50% 0%, rgba(197,161,94,.15), transparent 32%), linear-gradient(145deg,#eff4eb,#f8f7f0 52%,#e9f0e8);
}
.auth-page .navbar { background: rgba(255,255,255,.88); }
.auth-page .auth-container { padding: clamp(32px,5vw,66px) 20px; }
.auth-page .auth-card {
    position: relative; overflow: hidden;
    max-width: 485px; padding: clamp(28px,4.5vw,43px);
    border: 1px solid rgba(211,222,207,.9); border-radius: 27px;
    background: rgba(255,255,252,.94);
    box-shadow: 0 30px 75px rgba(22,56,39,.12), 0 6px 18px rgba(22,56,39,.045), inset 0 1px 0 #fff;
    backdrop-filter: blur(14px);
}
.auth-page .auth-card::before {
    position: absolute; top: 0; left: 8%; right: 8%; height: 3px;
    border-radius: 0 0 5px 5px; background: linear-gradient(90deg,transparent,#c5a15e 22%,#e3d09c 50%,#c5a15e 78%,transparent);
    content: "";
}
.auth-page .auth-heading { margin-bottom: 30px; }
.auth-page .auth-icon {
    width: 62px; height: 62px; margin-bottom: 19px; border: 1px solid #e5d5ad; border-radius: 19px;
    background: linear-gradient(145deg,#f9f1dc,#e7f1e7); color: #15563f;
    box-shadow: 0 9px 20px rgba(19,73,51,.09), inset 0 1px 0 #fff;
}
.auth-page .auth-heading h1 { font-size: clamp(26px,4vw,32px); font-weight: 850; letter-spacing: -.045em; color: #14271e; }
.auth-page .auth-heading p { color: #718076; font-size: 13px; }
.auth-page .auth-form { gap: 19px; }
.auth-page .form-group { gap: 8px; }
.auth-page .form-group label { color: #304b3b; font-size: 12px; letter-spacing: .015em; }
.auth-page .form-group input {
    min-height: 51px; padding: 13px 15px; border: 1px solid #dbe4d8; border-radius: 13px;
    background: #fff; color: #172b25; font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-page .form-group input:hover { border-color: #bdcfc0; }
.auth-page .form-group input:focus { border-color: #5b9071 !important; background: #fffefa; box-shadow: 0 0 0 4px rgba(27,105,73,.10) !important; }
.auth-page .form-group input::placeholder { color: #a1aca1; }
.auth-page .auth-button { min-height: 52px; margin-top: 4px; border-radius: 13px; font-size: 14px; }
.auth-page .auth-switch { margin-top: 25px; font-size: 13px; }
.auth-page .auth-switch a { color: #145846; }
.auth-page .auth-home-link { margin-top: 21px; }
.auth-page .auth-home-link a { color: #7b887a; }
.auth-page .flash-message { margin: 0 0 18px; }
.auth-page .footer { background: rgba(255,255,255,.72); }

/* Shared card / typography polish without changing page behavior */
.home-page h2, .news-page h2, .quiz-page h2, .result-page h2, .history-page h2 { letter-spacing: -.035em; }
.home-page .feature-card, .news-page .news-card, .quiz-page .question-card,
.result-page .answer-card, .history-page .history-panel { -webkit-backface-visibility: hidden; }
.messages-container { max-width: var(--content-width); }
hr { border: 0; border-top: 1px solid var(--border); }

/* Make long Hindi and English content behave well on narrow screens. */
@media (max-width: 1000px) {
    .home-page .features-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .news-page .news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .navbar { position: relative; min-height: auto; padding: 13px var(--mobile-gutter, 18px); }
    .home-page .hero, .news-page .news-hero, .quiz-page .quiz-hero,
    .result-page .result-hero, .history-page .history-hero { padding: 48px var(--mobile-gutter,18px); }
    .home-page .hero h1 { font-size: clamp(36px,9vw,55px); letter-spacing: -.05em; }
    .news-page .news-hero h1, .quiz-page .quiz-hero h1, .result-page .result-hero h1, .history-page .history-hero h1 { font-size: clamp(32px,7.8vw,45px); }
    .home-page .main-container, .news-page .main-container, .news-page .news-container,
    .quiz-page .main-container, .quiz-page .quiz-container, .result-page .result-container,
    .history-page .history-container { width: min(92%, var(--content-width)); margin-top: 29px; margin-bottom: 46px; }
    .home-page .features-grid, .quiz-page .features-grid { gap: 14px; }
    .home-page .feature-card, .quiz-page .feature-card, .news-page .news-card { border-radius: 18px; }
    .home-page .account-cta, .news-page .account-cta, .news-page .news-quiz-cta,
    .result-page .result-bottom-cta, .history-page .history-bottom-cta { border-radius: 19px; }
    .auth-page .auth-container { padding: 30px 16px; }
    .auth-page .auth-card { border-radius: 23px; }
}
@media (max-width: 620px) {
    .news-page .news-grid { grid-template-columns: minmax(0,1fr); }
    .news-page .news-card { min-height: 0; }
    .news-page .audio-panel { padding: 22px; border-radius: 19px; }
    .news-page .audio-form, .news-page .audio-form button, .news-page .audio-form .primary-btn { width: 100%; }
    .quiz-page .options-list { grid-template-columns: minmax(0,1fr); }
    .result-page .result-summary-card { grid-template-columns: minmax(0,1fr); gap: 22px; padding: 23px; }
    .result-page .score-circle { width: 145px; height: 145px; }
    .result-page .score-stats { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
    .result-page .score-stat { padding: 11px; }
    .result-page .score-stat strong { font-size: 21px; }
    .result-page .answer-detail { grid-template-columns: minmax(0,1fr); gap: 5px; }
    .home-page .language-section { grid-template-columns: minmax(0,1fr); gap: 20px; }
    .home-page .account-cta, .news-page .account-cta, .news-page .news-quiz-cta,
    .result-page .result-bottom-cta, .history-page .history-bottom-cta { align-items: stretch; flex-direction: column; }
    .home-page .account-cta .primary-btn, .news-page .account-cta .primary-btn,
    .news-page .news-quiz-cta .primary-btn, .result-page .result-bottom-cta .primary-btn,
    .history-page .history-bottom-cta .primary-btn { width: 100%; }
    .auth-page .auth-card { padding: 27px 21px; }
}
@media (max-width: 390px) {
    .brand { font-size: 14px; gap: 9px; }
    .brand-icon { width: 38px; min-width: 38px; height: 38px; border-radius: 12px; }
    .home-page .hero h1 { font-size: 32px; }
    .result-page .score-stats { grid-template-columns: minmax(0,1fr); }
    .result-page .score-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .result-page .score-stat strong { margin-top: 0; }
    .auth-page .auth-card { padding: 24px 17px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* =============================================================
   ULTRA-LUXURY FINISH — Daily Current Affairs
   Visual-only overrides. Existing classes, layout and behavior
   are retained so all current pages keep using this one stylesheet.
   Palette: midnight emerald, warm ivory, champagne gold.
============================================================= */
:root {
    --primary: #145640;
    --primary-dark: #0d3c2e;
    --primary-deep: #08291f;
    --primary-soft: #eaf1e8;
    --primary-pale: #f4f5ee;
    --background: #f4f3ed;
    --surface: #fffefa;
    --text: #15291f;
    --muted: #6c776d;
    --border: #e3e2d6;
    --border-strong: #d2d0bd;
    --danger: #a63d38;
    --danger-bg: #fff1ed;
    --success: #176247;
    --success-bg: #eaf5eb;
    --accent-gold: #c7a765;
    --accent-gold-light: #ead8a5;
    --shadow-sm: 0 8px 24px rgba(14, 43, 31, .055);
    --shadow-md: 0 18px 42px rgba(14, 43, 31, .095);
    --shadow-xl: 0 28px 75px rgba(12, 39, 28, .13);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 21px;
    --radius-xl: 28px;
}

html { scroll-padding-top: 18px; }
body {
    background:
        radial-gradient(ellipse at 8% 0%, rgba(199,167,101,.075), transparent 28rem),
        radial-gradient(ellipse at 100% 26%, rgba(20,86,64,.035), transparent 30rem),
        var(--background);
    color: var(--text);
    font-family: Inter, "Aptos", "Segoe UI", Arial, sans-serif;
    letter-spacing: -.006em;
}
::selection { color: #fffefa; background: #145640; }
:focus-visible { outline: 3px solid rgba(199,167,101,.58); outline-offset: 3px; }

/* Premium navigation shared across pages */
.navbar {
    min-height: 82px;
    background: rgba(255,254,250,.92);
    border-bottom: 1px solid rgba(199,167,101,.23);
    box-shadow: 0 5px 24px rgba(14,43,31,.035);
    backdrop-filter: blur(18px);
}
.brand { gap: 13px; font-size: 18px; letter-spacing: -.035em; }
.brand-icon {
    position: relative;
    overflow: hidden;
    width: 46px; min-width: 46px; height: 46px;
    border: 1px solid rgba(234,216,165,.72);
    border-radius: 15px;
    background: linear-gradient(145deg, #1b674d 0%, #0d3c2e 68%, #092b21 100%);
    color: #fffdf4;
    box-shadow: 0 7px 18px rgba(8,41,31,.19), inset 0 1px 0 rgba(255,255,255,.19);
    letter-spacing: .06em;
}
.brand-icon::after {
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255,255,255,.16), transparent 45%);
    content: ""; pointer-events: none;
}
.nav-link, .back-link, .logout-btn {
    border-radius: 11px;
    transition: transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.nav-link:hover, .back-link:hover { background: #f5f0e2; border-color: #e8ddbd; }
.nav-signup {
    border: 1px solid #c8aa6c;
    background: linear-gradient(135deg, #1b674d, #0c392b);
    box-shadow: 0 7px 17px rgba(8,41,31,.15), inset 0 1px rgba(255,255,255,.15);
}
.nav-signup:hover { background: linear-gradient(135deg, #227458, #104632); box-shadow: 0 10px 22px rgba(8,41,31,.2); }
.welcome-user { max-width: 230px; }

/* High-end button treatment */
.primary-btn, .auth-button, .quiz-submit-btn, .audio-generate-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid #c6a45f;
    border-radius: 12px;
    background: linear-gradient(135deg, #1b674d 0%, #104531 56%, #0b3326 100%);
    color: #fffdf5;
    box-shadow: 0 8px 20px rgba(10,54,39,.17), inset 0 1px 0 rgba(255,255,255,.16);
    letter-spacing: .005em;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.primary-btn::before, .auth-button::before, .quiz-submit-btn::before, .audio-generate-btn::before {
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 10%, rgba(255,255,255,.12) 42%, transparent 72%);
    content: ""; transform: translateX(-100%); transition: transform .55s ease;
}
.primary-btn:hover, .auth-button:hover, .quiz-submit-btn:hover, .audio-generate-btn:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
    box-shadow: 0 13px 28px rgba(10,54,39,.22), inset 0 1px 0 rgba(255,255,255,.18);
    color: #fffdf5;
}
.primary-btn:hover::before, .auth-button:hover::before, .quiz-submit-btn:hover::before, .audio-generate-btn:hover::before { transform: translateX(100%); }
.secondary-btn {
    border-color: #d9cead;
    background: linear-gradient(135deg, #fffefa, #f8f3e5);
    color: #315642;
    box-shadow: 0 5px 14px rgba(14,43,31,.035);
}
.secondary-btn:hover { border-color: #c7a765; background: #fffaf0; box-shadow: 0 9px 20px rgba(14,43,31,.075); }
button:active, .primary-btn:active, .secondary-btn:active { transform: translateY(0); }

/* Refined section headings and overlines */
.section-label {
    color: #82652e;
    letter-spacing: .17em;
    font-size: 10px;
}
.home-page h2, .news-page h2, .quiz-page h2, .result-page h2, .history-page h2 {
    letter-spacing: -.045em;
}

/* Deep emerald hero panels with restrained champagne details */
.home-page .hero, .news-page .news-hero, .quiz-page .quiz-hero,
.result-page .result-hero, .history-page .history-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-bottom: 1px solid rgba(199,167,101,.36);
    background:
        radial-gradient(ellipse at 88% 7%, rgba(199,167,101,.16), transparent 27%),
        radial-gradient(ellipse at 8% 100%, rgba(49,117,83,.32), transparent 38%),
        linear-gradient(118deg, #08271e 0%, #0d3d2d 48%, #14533c 100%);
}
.home-page .hero::before, .news-page .news-hero::before,
.quiz-page .quiz-hero::before, .result-page .result-hero::before,
.history-page .history-hero::before {
    position: absolute; inset: 0; z-index: -1;
    background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0, rgba(255,255,255,.018) 1px, transparent 1px, transparent 7px);
    opacity: .35; content: ""; pointer-events: none;
}
.home-page .hero::after, .news-page .news-hero::after,
.quiz-page .quiz-hero::after, .result-page .result-hero::after,
.history-page .history-hero::after {
    position: absolute; right: -95px; top: -150px; z-index: -1;
    width: clamp(230px, 34vw, 440px); height: clamp(230px, 34vw, 440px);
    border: 1px solid rgba(234,216,165,.22); border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(234,216,165,.025), 0 0 0 62px rgba(234,216,165,.022), 0 0 0 100px rgba(234,216,165,.015);
    content: ""; pointer-events: none;
}
.home-page .hero h1, .news-page .news-hero h1, .quiz-page .quiz-hero h1,
.result-page .result-hero h1, .history-page .history-hero h1 {
    color: #fffdf5;
    letter-spacing: -.055em;
    text-wrap: balance;
}
.home-page .hero h1 span { color: #e5cd91; }
.home-page .hero-content > p, .news-page .news-hero p,
.quiz-page .quiz-hero p, .result-page .result-hero p, .history-page .history-hero p {
    color: #d5e0d5;
}
.home-page .hero-badge {
    border-color: rgba(234,216,165,.4);
    background: rgba(255,253,245,.08);
    color: #f0dba9;
    backdrop-filter: blur(10px);
}
.home-page .hero .primary-btn, .news-page .news-hero .primary-btn,
.quiz-page .quiz-hero .primary-btn { box-shadow: 0 12px 26px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.16); }

/* Cards: ivory surfaces, controlled lift, and elegant edge highlights */
.home-page .feature-card, .news-page .news-card, .quiz-page .question-card,
.quiz-page .quiz-info-card, .quiz-page .quiz-info, .quiz-page .quiz-submit-card,
.result-page .result-summary-card, .result-page .answer-card,
.history-page .history-panel, .history-page .history-stat-card,
.history-page .history-table-wrapper, .history-page .history-chart-card,
.history-page .history-empty-state {
    border-color: rgba(213,214,199,.92);
    border-radius: 21px;
    background: linear-gradient(145deg, rgba(255,254,250,.99), rgba(250,250,244,.98));
    box-shadow: 0 10px 28px rgba(12,39,28,.048), 0 2px 5px rgba(12,39,28,.018), inset 0 1px 0 rgba(255,255,255,.96);
}
.home-page .feature-card, .news-page .news-card {
    position: relative; overflow: hidden;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), border-color .28s ease, box-shadow .28s ease;
}
.home-page .feature-card::before, .news-page .news-card::before {
    position: absolute; top: 0; left: 18px; right: 18px; height: 2px;
    background: linear-gradient(90deg, transparent, #c7a765, #ead8a5, #c7a765, transparent);
    opacity: .72; content: "";
}
.home-page .feature-card:hover, .news-page .news-card:hover {
    transform: translateY(-5px);
    border-color: #cfb980;
    box-shadow: 0 20px 42px rgba(12,39,28,.09), 0 5px 12px rgba(12,39,28,.035);
}
.home-page .feature-icon, .home-page .language-code {
    border: 1px solid #e4d8b8;
    background: linear-gradient(145deg, #fbf5e5, #eaf1e7);
    color: #195540;
    box-shadow: inset 0 1px 0 #fff, 0 5px 12px rgba(12,39,28,.035);
}
.home-page .language-section {
    border-color: #ded5b8;
    background: radial-gradient(circle at 100% 0%, rgba(199,167,101,.12), transparent 32%), linear-gradient(130deg,#fbfaf3,#fffefa 66%,#edf3e9);
    box-shadow: 0 13px 35px rgba(12,39,28,.045);
}
.home-page .language-card { border-color: #e4e2d4; box-shadow: 0 5px 15px rgba(12,39,28,.025); }
.home-page .language-card:hover { border-color: #cbb47a; box-shadow: 0 12px 25px rgba(12,39,28,.065); }
.home-page .account-cta, .news-page .news-quiz-cta, .result-page .result-bottom-cta,
.history-page .history-bottom-cta, .quiz-page .quiz-submit-card {
    border-color: #ded5b8;
    background: radial-gradient(circle at 100% 0%, rgba(199,167,101,.12), transparent 35%), linear-gradient(125deg,#fffefa,#f1f4eb);
    box-shadow: 0 13px 34px rgba(12,39,28,.055);
}

/* News reading and audio controls */
.news-page .audio-panel {
    position: relative; overflow: hidden;
    border: 1px solid rgba(234,216,165,.4);
    border-radius: 23px;
    background: radial-gradient(circle at 100% 0%, rgba(199,167,101,.17), transparent 30%), linear-gradient(125deg,#08291f,#104632 56%,#1a6045);
    box-shadow: 0 18px 36px rgba(8,41,31,.17), inset 0 1px 0 rgba(255,255,255,.08);
}
.news-page .audio-icon { border-color: rgba(234,216,165,.3); background: rgba(255,255,255,.09); }
.news-page .audio-generate-btn {
    border-color: #e6d09a; background: linear-gradient(135deg,#fffdf5,#f3e8c8); color: #123f2e;
    box-shadow: 0 8px 19px rgba(0,0,0,.12), inset 0 1px 0 #fff;
}
.news-page .news-category, .news-page .news-count {
    border-color: #e2d6b4; background: #f8f2e3; color: #80652f;
}
.news-page .news-card h3 { letter-spacing: -.025em; }
.news-page .news-metadata { color: #7d877d; }
.news-page .read-source-link { color: #145640; }

/* Quiz premium states */
.quiz-page .quiz-count, .result-page .review-count {
    border-color: #e3d5ae; background: linear-gradient(135deg,#faf4e4,#f3ecd8); color: #80652f;
}
.quiz-page .question-number {
    border: 1px solid #c7a765;
    background: linear-gradient(145deg,#1a674c,#0a3426);
    box-shadow: 0 7px 16px rgba(10,54,39,.15), inset 0 1px rgba(255,255,255,.15);
}
.quiz-page .question-card:focus-within { border-color: #c7a765; box-shadow: 0 17px 38px rgba(12,39,28,.085); }
.quiz-page .question-summary, .result-page .answer-context, .result-page .answer-explanation {
    border-color: #e5dcc2; border-left-color: #c7a765;
    background: linear-gradient(125deg,#faf7ec,#fffdf7); color: #67624f;
}
.quiz-page .option-label { min-height: 64px; border-color: #e2e2d5; border-radius: 14px; }
.quiz-page .option-label:hover { border-color: #c7a765; background: #fffcf4; box-shadow: 0 6px 17px rgba(12,39,28,.045); }
.quiz-page .option-label:has(input:checked) { border-color: #b99a59; background: linear-gradient(135deg,#f8f0dc,#edf3e8); box-shadow: inset 0 0 0 1px rgba(199,167,101,.18), 0 4px 14px rgba(12,39,28,.045); }
.quiz-page .option-label:has(input:checked) .option-letter { background: #145640; color: #fffdf5; }
.quiz-page .option-letter { background: #edf2e8; color: #145640; }
.quiz-page .quiz-submit-btn { min-height: 50px; }

/* Score / results finish */
.result-page .result-summary-card { border-color: #ded5b8; }
.result-page .score-circle { border-color: #d7c58e; background: radial-gradient(circle at 30% 15%,#fff,#f5f0df); box-shadow: inset 0 0 0 5px rgba(255,255,255,.85), 0 13px 28px rgba(12,39,28,.085); }
.result-page .score-circle strong { color: #145640; }
.result-page .score-stat { border-color: #e4e1d2; background: rgba(255,254,250,.9); }
.result-page .answer-card { border-left-color: #d5a4a0; }
.result-page .answer-card:has(.status-correct) { border-left-color: #2f845f; }
.result-page .status-correct { border-color: #d0e5d5; background: #edf6e9; }
.result-page .status-incorrect { border-color: #ecd2cc; background: #fff0ed; }

/* History tables and statistics */
.history-page .history-stat-card { position: relative; overflow: hidden; }
.history-page .history-stat-card::before {
    position: absolute; top: 0; left: 18px; right: 18px; height: 2px;
    background: linear-gradient(90deg,transparent,#c7a765,#ead8a5,#c7a765,transparent); content: "";
}
.history-page .history-panel-heading { border-bottom-color: #e6e2d3; }
.history-page .history-table { border-collapse: separate; border-spacing: 0; }
.history-page .history-table thead th { background: linear-gradient(135deg,#eff2e8,#f8f2e2); color: #415849; letter-spacing: .09em; }
.history-page .history-table td, .history-page .history-table th { border-bottom-color: #e8e5d9; }
.history-page .history-table tbody tr:hover { background: #faf8f0; }

/* Authentication pages — signup, login, forgot password and OTP */
.auth-page {
    background:
        radial-gradient(ellipse at 80% 4%, rgba(199,167,101,.16), transparent 29rem),
        radial-gradient(ellipse at 0% 72%, rgba(20,86,64,.075), transparent 27rem),
        linear-gradient(145deg,#eff1e8 0%,#f8f6ee 52%,#e9eee6 100%);
}
.auth-page .navbar { background: rgba(255,254,250,.88); backdrop-filter: blur(18px); }
.auth-page .auth-container { padding: clamp(35px,5.5vw,76px) 20px; }
.auth-page .auth-card {
    position: relative; isolation: isolate; overflow: hidden;
    max-width: 500px;
    border: 1px solid rgba(204,190,149,.55);
    border-radius: 29px;
    background: rgba(255,254,250,.96);
    box-shadow: 0 32px 85px rgba(11,43,31,.14), 0 7px 20px rgba(11,43,31,.045), inset 0 1px 0 #fff;
    backdrop-filter: blur(18px);
}
.auth-page .auth-card::before {
    position: absolute; top: 0; left: 7%; right: 7%; height: 3px; z-index: 1;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg,transparent,#b99755 18%,#f0dda6 50%,#b99755 82%,transparent);
    content: "";
}
.auth-page .auth-heading h1 { color: #102b20; letter-spacing: -.052em; text-wrap: balance; }
.auth-page .auth-heading p { color: #6c776d; line-height: 1.8; }
.auth-page .auth-icon {
    border: 1px solid #e4d4a8;
    background: radial-gradient(circle at 20% 0%,#fffdf5,#f4ecd7 58%,#e8f0e5);
    color: #145640;
    box-shadow: 0 12px 25px rgba(12,50,36,.09), inset 0 1px 0 #fff;
}
.auth-page .auth-form { gap: 19px; }
.auth-page .form-group { gap: 8px; }
.auth-page .form-group label { color: #304d3d; font-size: 12px; font-weight: 800; letter-spacing: .015em; }
.auth-page .form-group input, .auth-page .form-group select, .auth-page .form-group textarea {
    min-height: 52px; border: 1px solid #dfe1d3; border-radius: 14px;
    background: #fffefa; color: #172b25; font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(12,39,28,.018);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-page .form-group input:hover, .auth-page .form-group select:hover { border-color: #c8bd97; }
.auth-page .form-group input:focus, .auth-page .form-group select:focus, .auth-page .form-group textarea:focus {
    border-color: #7ca18a !important; background: #fffefa;
    box-shadow: 0 0 0 4px rgba(20,86,64,.095) !important; outline: none;
}
.auth-page .form-group input::placeholder { color: #a2a899; }
.auth-page .auth-button { width: 100%; min-height: 53px; margin-top: 4px; }
.auth-page .auth-switch { color: #70796f; }
.auth-page .auth-switch a, .auth-page .auth-forgot-row a { color: #145640; font-weight: 800; }
.auth-page .auth-switch a:hover, .auth-page .auth-forgot-row a:hover { color: #9a7737; text-decoration: underline; text-underline-offset: 3px; }
.auth-page .auth-forgot-row { display: flex; justify-content: flex-end; margin-top: -7px; font-size: 12px; }
.auth-page .auth-home-link a { color: #7a8276; }
.auth-page .auth-home-link a:hover { color: #145640; }
.auth-page .field-optional { color: #8d927f; font-weight: 600; font-size: 11px; }
.auth-page .field-help { color: #858c7f; font-size: 11px; }
.auth-page .flash-message { border-radius: 13px; box-shadow: 0 5px 14px rgba(12,39,28,.035); }
.auth-page .footer { border-top-color: rgba(199,167,101,.2); background: rgba(255,254,250,.75); }

/* Shared flash, empty-state and footer finish */
.flash-message { border-radius: 13px; box-shadow: 0 5px 14px rgba(12,39,28,.025); }
.flash-message.error, .flash-message.danger { border-color: #efccc5; background: #fff0ec; color: #963a35; }
.footer { border-top-color: rgba(199,167,101,.22); background: rgba(255,254,250,.94); }
.footer-brand .brand-icon { border-radius: 12px; }
.footer .copyright { color: #999886; }
hr { border-top-color: #e6e2d4; }

/* Admin cards are also polished if they share the global stylesheet */
.admin-card, .stat-card, .metric-card, .overview-card, .dashboard-card {
    border-color: #e2dfd0;
    border-radius: 20px;
    background: linear-gradient(145deg,#fffefa,#f9f8f0);
    box-shadow: 0 10px 27px rgba(12,39,28,.055), inset 0 1px 0 #fff;
}

/* Small screens: preserve the existing single-column responsive behavior */
@media (max-width: 760px) {
    .navbar { gap: 12px; }
    .brand { font-size: 16px; }
    .home-page .hero, .news-page .news-hero, .quiz-page .quiz-hero,
    .result-page .result-hero, .history-page .history-hero { padding-top: 48px; padding-bottom: 48px; }
    .home-page .hero h1, .news-page .news-hero h1, .quiz-page .quiz-hero h1,
    .result-page .result-hero h1, .history-page .history-hero h1 { letter-spacing: -.045em; }
    .auth-page .auth-card { box-shadow: 0 22px 55px rgba(11,43,31,.12), 0 5px 14px rgba(11,43,31,.04), inset 0 1px 0 #fff; }
}
@media (max-width: 620px) {
    .primary-btn, .secondary-btn, .auth-button, .quiz-submit-btn { min-height: 48px; }
    .news-page .audio-panel { border-radius: 19px; }
    .home-page .feature-card, .news-page .news-card, .quiz-page .question-card,
    .history-page .history-panel, .history-page .history-stat-card { border-radius: 18px; }
    .auth-page .auth-card { border-radius: 23px; }
}
@media (prefers-reduced-motion: reduce) {
    .home-page .feature-card, .news-page .news-card, .primary-btn, .secondary-btn,
    .auth-button, .quiz-submit-btn, .audio-generate-btn { transition: none !important; }
    .primary-btn:hover, .secondary-btn:hover, .auth-button:hover,
    .quiz-submit-btn:hover, .audio-generate-btn:hover,
    .home-page .feature-card:hover, .news-page .news-card:hover { transform: none !important; }
}

