:root {
    --color-primary: #4a8dcd;
    --color-primary-dark: #2f6797;
    --color-primary-soft: rgba(74, 141, 205, 0.15);
    --color-accent: #e1b667;
    --color-accent-soft: rgba(225, 182, 103, 0.14);
    --color-bg: #3f6790;
    --color-bg-deep: #32587f;
    --color-panel: #456f99;
    --color-panel-strong: #3a628c;
    --color-panel-soft: #5f89b1;
    --color-surface: rgba(67, 106, 146, 0.94);
    --color-surface-strong: rgba(58, 95, 133, 0.96);
    --color-surface-muted: #6d94b8;
    --color-border: rgba(190, 220, 246, 0.24);
    --color-text: #eff6fc;
    --color-text-soft: #d5e2ef;
    --color-link-muted: #aac1d8;
    --shadow-sm: 0 16px 36px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 24px 48px rgba(0, 0, 0, 0.28);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Nunito", "Avenir Next", "Aptos", "Segoe UI", "Trebuchet MS", "Verdana", system-ui, sans-serif;
    background:
    radial-gradient(circle at top left, rgba(80, 145, 210, 0.16), transparent 32%),
    radial-gradient(circle at right 10%, rgba(225, 182, 103, 0.08), transparent 22%),
    linear-gradient(180deg, #8fb2d5 0%, #7398be 22%, var(--color-bg) 56%, var(--color-bg-deep) 100%);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.65;
    letter-spacing: 0.018em;
}

.page-index {
    background:
        linear-gradient(180deg, rgba(66, 103, 142, 0.14), rgba(44, 79, 114, 0.18)),
        linear-gradient(180deg, #95b4d4 0%, #6d95bc 22%, #4f78a2 56%, #40678f 100%);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: #8ec7ff;
}

a:hover {
    color: #c6e4ff;
}

.top-bar {
    background: linear-gradient(135deg, #2d5b86 0%, #3a6d9c 48%, #4d83b1 100%);
    color: #fff;
    padding: 30px 20px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.top-bar h1,
.hero h2,
.content h2,
.result-block h3,
.ia-result h3,
.contact-label,
.menu-title,
.return-nav__label {
    font-family: inherit;
}

.top-bar h1 {
    font-size: clamp(1.7rem, 2.6vw, 2.55rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: 800;
}

.top-bar p {
    margin-top: 8px;
    max-width: 760px;
    color: rgba(237, 244, 251, 0.88);
    font-size: 1.02rem;
}

.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 34px 20px 56px;
}

.hero,
.section-card,
.ia-result,
.info-panel,
.list-card,
.error-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(5px);
}

.hero {
    padding: 34px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.page-index .hero {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, rgba(34, 67, 102, 0.10) 50%, rgba(49, 86, 123, 0.28) 74%, rgba(63, 103, 144, 0.72) 100%),
        linear-gradient(180deg, #95b8d9 0%, #7ba2c8 22%, #638ab1 52%, #527aa2 76%, #4a7199 100%);
    min-height: 720px;
    display: flex;
    align-items: flex-start;
    padding-top: 24px;
    padding-bottom: 34px;
    border-color: rgba(190, 220, 246, 0.22);
}

.page-index .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(12, 30, 48, 0.02) 0%, rgba(24, 53, 82, 0.05) 42%, rgba(45, 77, 110, 0.10) 68%, rgba(63, 103, 144, 0.22) 100%),
        url("/static/images/lycee_banner.jpg") top right / cover no-repeat;
    background-position: top right;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -60px -70px auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(225, 182, 103, 0.16), transparent 70%);
    pointer-events: none;
}

.page-index .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 58%,
        rgba(74, 113, 153, 0.18) 72%,
        rgba(74, 113, 153, 0.48) 86%,
        rgba(74, 113, 153, 0.82) 100%
    );
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: #d7eaff;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.page-index .eyebrow {
    background: rgba(34, 69, 102, 0.72);
    color: #f8e7c1;
}

.hero h2,
.content h2 {
    font-size: clamp(1.65rem, 2.35vw, 2.35rem);
    line-height: 1.14;
    letter-spacing: -0.012em;
    margin-bottom: 12px;
    font-weight: 800;
}

.hero p,
.section-intro,
.content .lead {
    color: var(--color-text-soft);
    font-size: 1.04rem;
    max-width: 780px;
}

.page-index .hero h2,
.page-index .hero p {
    color: #ffffff;
}

.section-card,
.list-card,
.info-panel,
.error-card,
.ia-result {
    padding: 26px;
}

.menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.menu a,
.home-card {
    display: flex;
    flex-direction: column;
    min-height: 100px;
    padding: 20px;
    text-decoration: none;
    font-size: 1rem;
    color: var(--color-text);
    background: linear-gradient(180deg, rgba(79, 118, 156, 0.88) 0%, rgba(61, 96, 132, 0.90) 100%);
	border: 1px solid rgba(190, 220, 246, 0.18);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.menu a {
    justify-content: center;
    font-weight: 700;
}

.menu a::after {
    content: "→";
    margin-top: 10px;
    font-size: 1.1rem;
    color: var(--color-accent);
}

.menu a:hover,
.menu a:focus-visible,
.home-card:hover,
.home-card:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(142, 199, 255, 0.44);
    background: linear-gradient(180deg, rgba(80, 120, 160, 0.98) 0%, rgba(56, 90, 125, 0.98) 100%);
    outline: none;
}

.home-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 22px;
    align-items: stretch;
}

.home-card {
    justify-content: space-between;
    gap: 14px;
}

.menu-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #f3f8fd;
}

.home-card p {
    color: #d2e1ef;
    font-size: 0.98rem;
    max-width: none;
}

.home-card .btn-secondary {
    align-self: flex-start;
    margin-top: auto;
}

.actions-inline {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-primary,
.btn-secondary,
.link-back,
.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 18px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, var(--color-primary) 0%, #5aa7ef 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(16, 61, 104, 0.34);
    cursor: pointer;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px rgba(16, 61, 104, 0.4);
    outline: none;
}

.btn-secondary,
.link-back,
.breadcrumb-link {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(142, 199, 255, 0.24);
    color: #e9f3fc;
}

.btn-secondary:hover,
.link-back:hover,
.breadcrumb-link:hover,
.btn-secondary:focus-visible,
.link-back:focus-visible,
.breadcrumb-link:focus-visible {
    transform: translateY(-2px);
    outline: none;
    background: rgba(255,255,255,0.15);
}

.info-grid {
    display: none;
}

.ia-form {
    display: grid;
    gap: 18px;
    margin-top: 22px;
    align-items: stretch;
}

.form-label {
    font-weight: 700;
    font-size: 1.02rem;
    color: #e3f0fb;
}

textarea,
input[type="text"] {
    width: 100%;
    border: 1px solid rgba(142, 199, 255, 0.24);
    border-radius: 20px;
    padding: 16px 18px;
    font: inherit;
    color: var(--color-text);
    background: rgba(255,255,255,0.10);
    resize: vertical;
    min-height: 58px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
    min-height: 150px;
}

textarea:focus,
input[type="text"]:focus {
    border-color: rgba(142, 199, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(47, 115, 183, 0.18);
    background: rgba(255,255,255,0.15);
    outline: none;
}

textarea::placeholder,
input[type="text"]::placeholder {
    color: rgba(237, 244, 251, 0.68);
}

.form-help {
    color: var(--color-text-soft);
    font-size: 0.96rem;
    margin-top: -8px;
}

.ia-result h3,
.result-block h3 {
    color: #cfe7ff;
    font-size: 1.08rem;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.result-block + .result-block {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid rgba(142, 199, 255, 0.16);
}

.ia-question {
    padding: 16px 18px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(142, 199, 255, 0.18);
    border-radius: var(--radius-md);
    font-weight: 600;
    white-space: pre-wrap;
}

.ia-answer {
    white-space: normal;
    line-height: 1.85;
    color: var(--color-text);
}

/* ===== Mode IA (FAQ / IA étendue) ===== */
.mode-indicator {
    display: inline-block;
    margin: 6px 0 12px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(142, 199, 255, 0.25);
    color: #e6f2ff;
}

.chunk-indicator {
    display: inline-block;
    margin: 0 0 14px 10px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(142, 199, 255, 0.25);
    color: #e6f2ff;
}

.chunk-found {
    background: rgba(120, 210, 160, 0.14);
    border-color: rgba(120, 210, 160, 0.35);
}

.chunk-zero {
    background: rgba(255, 170, 120, 0.14);
    border-color: rgba(255, 170, 120, 0.35);
}

.mode-faq {
    background: rgba(100, 180, 255, 0.15);
    border-color: rgba(100, 180, 255, 0.4);
}

.mode-standard {
    background: rgba(255, 200, 100, 0.15);
    border-color: rgba(255, 200, 100, 0.4);
}

.stack {
    display: grid;
    gap: 20px;
}

.return-nav {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.return-nav__label {
    color: #d6e9fb;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.breadcrumb-link {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.96rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.breadcrumb-sep {
    color: var(--color-link-muted);
    font-weight: 700;
}

.bandeau {
    max-width: var(--max-width);
    margin: 0 auto 30px;
    padding: 0 20px 10px;
}

.bandeau span {
    display: block;
    background: rgba(49, 86, 123, 0.95);
    border: 1px solid rgba(142, 199, 255, 0.18);
    border-radius: 16px;
    padding: 14px 18px;
    color: var(--color-text-soft);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.page-faq .menu a,
.page-index .menu a,
.page-nsi .menu a,
.page-ia .menu a,
.page-contact .menu a {
    min-height: 86px;
}

.error-card {
    border-left: 6px solid var(--color-accent);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.contact-item {
    display: grid;
    gap: 8px;
    padding: 18px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(142, 199, 255, 0.16);
    border-radius: var(--radius-md);
}

.contact-label {
    font-size: 0.98rem;
    font-weight: 700;
    color: #cfe7ff;
}

.contact-value {
    color: var(--color-text);
    line-height: 1.7;
}

@media (max-width: 980px) {
    .home-links {
        grid-template-columns: 1fr;
    }

    .page-index .hero {
        min-height: 560px;
        padding-top: 0;
        padding-bottom: 24px;
    }
}

@media (max-width: 760px) {
    .top-bar {
        padding: 24px 18px;
    }

    .content {
        padding: 24px 16px 40px;
    }

    .hero,
    .section-card,
    .ia-result,
    .info-panel,
    .list-card,
    .error-card {
        padding: 22px;
        border-radius: 20px;
    }

    .page-index .hero {
		min-height: 500px;
		padding-top: 0;
		padding-bottom: 18px;
	}

    .page-index .hero__content {
		padding: 32px 20px 14px;
	}

    .menu {
        grid-template-columns: 1fr;
    }
}
  
.page-index .hero h2 {
    margin-bottom: 10px;
}

.page-index .hero p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.94);
}

.section-card,
.list-card,
.info-panel,
.error-card,
.ia-result,
.hero {
    background-color: var(--color-surface);
}

.page-index .hero {
    background-color: transparent;
}

@media (max-width: 900px) {
    .page-index .hero {
        min-height: 500px;
    }

    .page-index .hero::before {
        background:
            linear-gradient(180deg, rgba(11, 28, 44, 0.04) 0%, rgba(17, 43, 67, 0.09) 44%, rgba(24, 53, 82, 0.18) 72%, rgba(29, 62, 93, 0.42) 100%),
            url("/static/images/lycee_banner.jpg") top center / cover no-repeat;
    }

    .page-index .hero__content {
        max-width: none;
        padding: 18px 20px 0;
    }

    .home-links {
        grid-template-columns: 1fr;
    }
}


.page-index .content {
    max-width: 100%;
    padding: 0 0 56px;
}

.page-index .hero {
    width: 100%;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.18);
}

.page-index .hero__content {
    width: min(100%, 1120px);
    max-width: 760px;
    margin: 0 auto;
    padding: 35px 20px 14px;
}

.page-index .home-links {
    max-width: var(--max-width);
}

@media (max-width: 900px) {
    .page-index .content {
        padding-bottom: 42px;
    }

    .page-index .hero {
        border-radius: 0 0 24px 24px;
    }

    .page-index .hero__content {
        padding: 18px 20px 0;
    }
}
