﻿:root {
  --blue: #1f4e8c;
  --blue-dark: #15345d;
  --red: #d62839;
  --red-dark: #9f1d2a;
  --cream: #fff8ef;
  --soft: #f4f7fb;
  --text: #243044;
  --muted: #66758d;
  --yellow: #f4c95d;
  --green: #198754;
  --white: #fff;
  --shadow: 0 22px 55px rgba(20, 40, 80, .13);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--text);
  font-family: "Nunito", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
h1, h2, h3, h4, .navbar-brand { font-family: "Montserrat", "Segoe UI", sans-serif; }
a { color: inherit; }

.navbar {
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 32px rgba(21,52,93,.08);
}
.navbar-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--blue-dark); font-weight: 900; }
.brand-logo { width: auto; height: 42px; object-fit: contain; }
.nav-link { padding: .55rem .9rem !important; border-radius: 999px; color: var(--text); font-weight: 900; }
.nav-link:hover, .nav-link.active { color: var(--blue); background: rgba(31,78,140,.08); }

.global-course-switcher { position: fixed; right: 1rem; top: 5.25rem; z-index: 1200; font-family: Arial, sans-serif; }
.global-course-switcher details { position: relative; }
.global-course-switcher summary {
  min-height: 42px; display: flex; align-items: center; gap: .5rem; padding: 0 1rem;
  border-radius: 999px; list-style: none; cursor: pointer; background: var(--blue-dark);
  color: #fff; font-weight: 900; box-shadow: 0 14px 32px rgba(15,23,42,.18);
}
.global-course-switcher summary::-webkit-details-marker { display: none; }
.global-course-switcher summary::after { content: "⌄"; }
.global-course-switcher details[open] summary::after { transform: rotate(180deg); }
.global-course-switcher nav {
  position: absolute; top: calc(100% + .5rem); right: 0; width: min(260px, calc(100vw - 2rem));
  display: grid; gap: .35rem; padding: .65rem; border: 1px solid rgba(21,52,93,.12);
  border-radius: 18px; background: #fff; box-shadow: 0 20px 45px rgba(15,23,42,.18);
}
.global-course-switcher a { min-height: 40px; display: flex; align-items: center; padding: 0 .85rem; border-radius: 12px; color: var(--blue-dark); text-decoration: none; font-weight: 900; }
.global-course-switcher a:hover { background: #eef5ff; color: var(--red); }

.hero {
  min-height: min(700px, 86vh); display: flex; align-items: center; position: relative; overflow: hidden;
  padding: 7rem 0 5rem; color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(255,255,255,.18), transparent 27%),
    radial-gradient(circle at 88% 12%, rgba(244,201,93,.18), transparent 24%),
    linear-gradient(135deg, rgba(21,52,93,.82), rgba(31,78,140,.58) 48%, rgba(214,40,57,.42)), var(--hero-image, linear-gradient(135deg, #15345d, #1f4e8c 55%, #d62839)) center/cover no-repeat;
}
.hero::after { content: ""; position: absolute; right: -8rem; bottom: -14rem; width: 40rem; height: 40rem; border: 5rem solid rgba(255,255,255,.07); border-radius: 50%; }
.hero .container { position: relative; z-index: 1; }
.badge-course, .status-pill, .skill-pill, .grammar-pill {
  display: inline-flex; align-items: center; gap: .45rem; width: max-content; border-radius: 999px;
  padding: .42rem .72rem; font-size: .82rem; font-weight: 900;
}
.badge-course { padding: .7rem 1rem; background: rgba(255,255,255,.9); color: var(--blue-dark); }
.hero h1 { margin: 1.2rem 0 .8rem; max-width: 850px; font-size: clamp(2.8rem, 7vw, 6rem); font-weight: 900; line-height: .98; letter-spacing: -.055em; text-shadow: 0 12px 34px rgba(0,0,0,.22); }
.hero-lead { margin: 1.1rem 0; font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 900; }
.hero-text { max-width: 760px; color: rgba(255,255,255,.9); font-size: 1.08rem; line-height: 1.75; }
.hero-visual { min-height: 380px; display: grid; place-items: center; position: relative; border: 1px solid rgba(255,255,255,.24); border-radius: 38px; background: rgba(255,255,255,.12); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.hero-visual::before { content: "Bonjour !"; font: 900 clamp(2.2rem, 5vw, 4.5rem)/1 "Montserrat", sans-serif; transform: rotate(-5deg); }
.hero-visual .orbit { position: absolute; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 24px; background: #fff; color: var(--red); font-size: 2rem; box-shadow: 0 18px 35px rgba(15,23,42,.22); }
.hero-visual .orbit.one { top: 2rem; right: 2rem; }
.hero-visual .orbit.two { bottom: 2rem; left: 2rem; color: var(--blue); }

.btn-main, .btn-soft {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .82rem 1.2rem; border-radius: 999px; text-decoration: none; font-weight: 900;
}
.btn-main { border: 0; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; box-shadow: 0 16px 34px rgba(214,40,57,.22); }
.btn-main:hover { color: #fff; transform: translateY(-2px); }
.btn-soft { border: 2px solid rgba(31,78,140,.18); background: #fff; color: var(--blue-dark); }
.hero .btn-soft { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.12); color: #fff; }
.hero .btn-soft:hover { background: #fff; color: var(--blue-dark); }

.quick-access-panel { max-width: 1120px; margin: -1.35rem auto 0; position: relative; z-index: 5; padding: 1rem; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.quick-access-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.quick-access-header h2 { margin: 0; color: var(--blue-dark); font-size: 1.15rem; font-weight: 900; }
.quick-access-header span { color: var(--red); font-weight: 900; }
.quick-access-dropdown { overflow: hidden; border: 1px solid rgba(31,78,140,.12); border-radius: 18px; background: #f8fbff; }
.quick-access-dropdown summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; cursor: pointer; list-style: none; color: var(--blue-dark); font-weight: 900; }
.quick-access-dropdown summary::-webkit-details-marker { display: none; }
.quick-access-dropdown summary::after { content: "+"; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-dark); color: #fff; }
.quick-access-dropdown[open] summary::after { content: "−"; }
.quick-link-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: .65rem; padding: 0 .9rem .9rem; }
.quick-link-list a { min-height: 46px; display: flex; align-items: center; gap: .65rem; padding: .65rem .75rem; border: 1px solid rgba(31,78,140,.1); border-radius: 14px; background: #fff; color: var(--blue-dark); text-decoration: none; font-weight: 900; }
.quick-link-list b { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-dark); color: #fff; font-size: .78rem; }

section { padding: 4.5rem 0; }
.section-kicker { margin-bottom: .6rem; color: var(--red); font-size: .82rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.section-title { color: var(--blue-dark); font-size: clamp(2rem,4vw,3.15rem); font-weight: 900; letter-spacing: -.035em; }
.section-text { color: var(--muted); font-size: 1.04rem; line-height: 1.72; }
.section-heading { max-width: 760px; margin: 0 auto 2.4rem; text-align: center; }
.bg-white { background: #fff; }

.portal-card, .theme-card, .activity-card, .content-card, .audio-card, .note-card {
  height: 100%; overflow: hidden; border: 0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
}
.card-visual { min-height: 205px; display: grid; place-items: center; position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, rgba(21,52,93,.04), rgba(21,52,93,.3)), var(--card-image, linear-gradient(135deg, var(--blue-dark), var(--blue) 55%, var(--red))) center/cover no-repeat; }
.card-visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.08), transparent 28%), radial-gradient(circle at 80% 90%, rgba(244,201,93,.1), transparent 32%); }
.card-visual i { position: relative; font-size: 4rem; filter: drop-shadow(0 12px 18px rgba(0,0,0,.18)); }
.card-visual.alt { background: linear-gradient(180deg, rgba(159,29,42,.03), rgba(159,29,42,.28)), var(--card-image, linear-gradient(135deg, #9f1d2a, #d62839 55%, #f4c95d)) center/cover no-repeat; }
.card-visual.green { background: linear-gradient(180deg, rgba(11,79,74,.03), rgba(11,79,74,.28)), var(--card-image, linear-gradient(135deg, #0b4f4a, #198754 58%, #65c18c)) center/cover no-repeat; }
.portal-icon, .theme-number { position: absolute; left: 1rem; bottom: 1rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: #fff; color: var(--red); font-size: 1.45rem; font-weight: 900; box-shadow: 0 12px 25px rgba(15,23,42,.18); }
.portal-card .card-body, .theme-card .card-body, .activity-card .card-body { display: flex; flex-direction: column; gap: .8rem; padding: 1.4rem; }
.portal-card h3, .theme-card h3, .activity-card h3, .content-card h3 { color: var(--blue-dark); font-weight: 900; }
.portal-card p, .theme-card p, .activity-card p { color: var(--muted); line-height: 1.65; }
.portal-card .btn-main, .theme-card .btn-main, .activity-card .btn-main { margin-top: auto; }
.status-pill { background: #e9f7ef; color: #11633c; }
.skill-pill { background: #eef5ff; color: var(--blue-dark); }
.grammar-pill { background: #fff4d6; color: #765000; }

.theme-grid, .activity-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(290px,1fr)); gap: 1.35rem; }
.unit-folder { overflow: hidden; margin-bottom: 1rem; border: 1px solid rgba(31,78,140,.12); border-radius: 24px; background: #fff; box-shadow: 0 14px 34px rgba(20,40,80,.08); }
.unit-folder > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem; cursor: pointer; list-style: none; }
.unit-folder > summary::-webkit-details-marker { display: none; }
.folder-number { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; border-radius: 16px; background: var(--blue-dark); color: #fff; font-weight: 900; }
.folder-copy { flex: 1; }
.folder-copy h3 { margin: 0; color: var(--blue-dark); font-size: 1.15rem; font-weight: 900; }
.folder-copy p { margin: .25rem 0 0; color: var(--muted); }
.folder-count { color: var(--red); font-weight: 900; white-space: nowrap; }
.unit-folder .activity-grid { padding: 0 1.25rem 1.25rem; }

.lesson-hero { min-height: 460px; padding-top: 8rem; }
.breadcrumb-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; color: rgba(255,255,255,.8); font-weight: 800; }
.breadcrumb-row a { color: #fff; }
.lesson-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 1.5rem; align-items: start; }
.lesson-main { display: grid; gap: 1.25rem; }
.content-card { padding: clamp(1.25rem,3vw,2rem); }
.content-card h2 { color: var(--blue-dark); font-weight: 900; }
.lesson-aside { position: sticky; top: 6.5rem; display: grid; gap: 1rem; }
.aside-nav { padding: 1rem; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.aside-nav h2 { color: var(--blue-dark); font-size: 1rem; font-weight: 900; }
.aside-nav a { display: block; padding: .65rem .75rem; border-radius: 12px; color: var(--blue-dark); text-decoration: none; font-weight: 800; }
.aside-nav a:hover { background: #eef5ff; }

.alphabet-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(64px,1fr)); gap: .65rem; }
.letter-card { border: 1px solid rgba(31,78,140,.15); cursor: pointer; font: inherit; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.letter-card i { color: var(--blue); font-size: .8rem; opacity: .68; }
.letter-card:hover, .letter-card:focus-visible, .letter-card[aria-pressed="true"] { transform: translateY(-3px); border-color: var(--blue); box-shadow: 0 10px 24px rgba(31,78,140,.16); outline: none; }
.letter-card { min-height: 80px; display: grid; place-items: center; padding: .5rem; border: 1px solid rgba(31,78,140,.12); border-radius: 18px; background: #f8fbff; text-align: center; }
.letter-card strong { color: var(--blue-dark); font-size: 1.65rem; }
.letter-card small { display: block; color: var(--muted); font-weight: 800; }
.sound-grid, .number-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: .85rem; }
.sound-card, .number-card { padding: 1rem; border-radius: 18px; background: #eef5ff; border-left: 5px solid var(--blue); }
.sound-card strong, .number-card strong { color: var(--blue-dark); }
.model-dialogue { display: grid; gap: .75rem; padding: 1rem; border-radius: 20px; background: var(--cream); }
.speech { width: fit-content; max-width: 86%; padding: .75rem 1rem; border-radius: 18px 18px 18px 4px; background: #fff; box-shadow: 0 8px 20px rgba(20,40,80,.08); }
.speech.reply { justify-self: end; border-radius: 18px 18px 4px 18px; background: var(--blue-dark); color: #fff; }
.callout { padding: 1rem 1.1rem; border-radius: 18px; border-left: 6px solid var(--yellow); background: #fff8dc; }
.table-responsive { border-radius: 18px; }
.table thead th { background: var(--blue-dark); color: #fff; border: 0; }

.source-lesson { max-width: 1040px; margin: 0 auto; }
.source-lesson .source-title { margin-bottom: 1rem; color: var(--blue-dark); font-size: clamp(1.8rem,4vw,2.7rem); font-weight: 900; }
.source-lesson h2 { margin-top: 2rem; padding-left: .9rem; border-left: 5px solid var(--red); }
.source-lesson h3 { margin-top: 1.25rem; color: var(--blue-dark); font-weight: 900; }
.source-lesson p, .source-lesson li { color: var(--text); font-size: 1.02rem; line-height: 1.72; }
.source-lesson .styled-table { width: 100%; margin: 1.4rem 0; overflow: hidden; border-collapse: separate; border-spacing: 0; border-radius: 18px; box-shadow: 0 12px 28px rgba(20,40,80,.09); }
.source-lesson .styled-table th, .source-lesson .styled-table td { padding: .85rem 1rem; border-bottom: 1px solid #e7edf5; text-align: left; }
.source-lesson .styled-table thead th { background: var(--blue-dark); color: #fff; }
.source-lesson .styled-table tbody tr:nth-child(even) { background: #f7faff; }
.source-lesson .example-box, .source-lesson .info-box, .source-lesson .rule-box, .source-lesson .special-case-box, .source-lesson .summary { margin: 1.25rem 0; padding: 1rem 1.15rem; border-radius: 18px; }
.source-lesson .example-box, .source-lesson .info-box { border-left: 6px solid var(--blue); background: #eef5ff; }
.source-lesson .rule-box { border-left: 6px solid var(--red); background: #fff0f3; }
.source-lesson .special-case-box { border-left: 6px solid #e98a15; background: #fff4e6; }
.source-lesson .summary { border-left: 6px solid var(--green); background: #e9f7ef; }
.source-lesson .verb-conjugation { margin: 0; padding: 0; list-style: none; }
.source-lesson .verb-conjugation li { padding: .25rem 0; }
.lesson-divider { margin: 3rem 0; border: 0; border-top: 3px solid rgba(31,78,140,.14); opacity: 1; }

.quiz-shell { max-width: 920px; margin: 0 auto; }
.quiz-progress { height: 10px; overflow: hidden; border-radius: 999px; background: #dfe7f2; }
.quiz-progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,var(--blue),var(--red)); transition: width .25s ease; }
.question-card { padding: 1.2rem; margin: 1rem 0; border: 1px solid rgba(31,78,140,.12); border-radius: 20px; background: #fff; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: .65rem; }
.option-btn, .audio-btn {
  min-height: 48px; border: 2px solid rgba(31,78,140,.16); border-radius: 14px; background: #fff;
  color: var(--blue-dark); font-weight: 900;
}
.option-btn:hover, .option-btn:focus-visible { border-color: var(--blue); background: #eef5ff; }
.option-btn.correct { border-color: var(--green); background: #e9f7ef; color: #11633c; }
.option-btn.wrong { border-color: var(--red); background: #fff0f3; color: var(--red-dark); }
.audio-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .65rem .9rem; background: var(--blue-dark); color: #fff; }
.feedback-box { min-height: 54px; margin-top: .85rem; padding: .8rem 1rem; border-radius: 14px; background: #f4f7fb; color: var(--muted); font-weight: 800; }
.score-panel { padding: 1.2rem; border-radius: 20px; background: var(--blue-dark); color: #fff; text-align: center; }

.audio-list { display: grid; gap: 1rem; }
.audio-card { padding: 1.2rem; }
.audio-card audio { width: 100%; margin-top: .75rem; }
.phrase-list { display: grid; gap: .65rem; }
.phrase-item { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; padding: .9rem 1rem; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(20,40,80,.07); }

.footer { padding: 3rem 0; background: var(--blue-dark); color: #fff; }
.footer a { color: #fff; text-decoration: none; font-weight: 900; }

@media (max-width: 991px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-aside { position: static; }
  .hero-visual { min-height: 280px; margin-top: 2rem; }
}
@media (max-width: 575px) {
  .global-course-switcher { top: auto; right: .75rem; bottom: .75rem; }
  .hero { min-height: auto; padding: 6rem 0 3.5rem; }
  .lesson-hero { min-height: 380px; }
  .hero h1 { font-size: clamp(2.55rem,15vw,4rem); }
  section { padding: 3.25rem 0; }
  .quick-access-panel { width: calc(100% - 1.5rem); margin-top: -.75rem; }
  .btn-main, .btn-soft { width: 100%; }
  .unit-folder > summary { align-items: flex-start; }
  .folder-count { display: none; }
  .phrase-item { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

