/* Python IDE: the colours and the pages around the task page (Learn Python, Select your school,
 * Badge unlocked). The task page's own layout is task.css; the editor and console are engine/lab.css. */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-tertiary: #1e2139;
    --bg-card: #1a1f3a;
    --text-primary: #ffffff;
    --text-secondary: #b4b8d0;
    --text-muted: #7a7e9a;
    --border-color: rgba(255, 255, 255, 0.1);
}
/* Page theme (Settings): the look of everything around the code. Dark is the colours above; Light is
   html.page-light, and is what a page is until another is chosen (the three places below put it on). The code keeps its own Background: the two settings are separate. Cream, Yellow and Blue are light
   pages, so they carry page-light as well as their own class and change only these colours. High contrast is
   html.page-contrast on its own. A new theme is a block here, a circle in Settings (task.php, task.css) and its name in
   the three places that put the class on (page.js, task.php, includes/page.php). */
html.page-light {
    --bg-primary: #f3f5fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9edf6;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.16);
}
html.page-cream {
    --bg-primary: #f5edcf;
    --bg-secondary: #fdf8e4;
    --bg-tertiary: #ebe1bb;
    --bg-card: #fdf8e4;
    --text-primary: #2a2416;
    --text-secondary: #5b5340;
    --text-muted: #746b54;
    --border-color: rgba(60, 45, 10, 0.22);
}
html.page-yellow {
    --bg-primary: #fbeea0;
    --bg-secondary: #fff8cf;
    --bg-tertiary: #f3e283;
    --bg-card: #fff8cf;
    --text-primary: #231f08;
    --text-secondary: #554e1e;
    --text-muted: #6b632b;
    --border-color: rgba(70, 60, 0, 0.26);
}
html.page-blue {
    --bg-primary: #d3e8f8;
    --bg-secondary: #eaf5fd;
    --bg-tertiary: #c1dcf1;
    --bg-card: #eaf5fd;
    --text-primary: #0f2233;
    --text-secondary: #3d566b;
    --text-muted: #566d81;
    --border-color: rgba(15, 50, 80, 0.22);
}
html.page-contrast {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #1c1c1c;
    --bg-card: #000000;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #d6d6d6;
    --border-color: rgba(255, 255, 255, 0.65);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; }

/* locked task in the top bar: a number that is not a link yet */
.tnav-bar span.seg { opacity: .45; }


.py-narrow { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }
.py-narrow h1 { font-size: 1.5rem; margin: 0 0 1rem; }
.py-narrow a { color: var(--text-primary); }
.py-centre { text-align: center; }

.py-btn { display: inline-block; font: inherit; font-weight: 600; border-radius: 8px; padding: .5rem 1.1rem; cursor: pointer; text-decoration: none; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.py-btn-go, .py-narrow a.py-btn-go { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.py-btn-big { font-size: 1.1rem; padding: .7rem 1.4rem; }

.py-badge-img { display: block; width: 220px; height: 220px; margin: 1rem auto; border-radius: 50%; object-fit: cover; }
.py-badge-name { font-size: 1.1rem; font-weight: 700; margin: 0 0 1.5rem; }

.py-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.py-list li { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: .75rem 1rem; margin-bottom: .5rem; }
.py-list-title { flex: 1; font-weight: 700; }
.py-list-count { color: var(--text-secondary); font-size: .9rem; font-weight: 400; }
/* Python at home's path (includes/home.php): the topics in order, the one reached open on its steps */
.py-home { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.py-home > li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border-color); }
.py-home-n { width: 2rem; color: var(--text-secondary); }
.py-home-t { flex: 1; font-weight: 700; }
.py-home .py-list { flex-basis: 100%; margin: .5rem 0 .25rem 3rem; }
.py-input { width: 100%; font: inherit; font-size: 1.05rem; padding: .6rem .8rem; border-radius: 8px; margin-bottom: .75rem; color: var(--text-primary); background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.py-schools li { padding: 0; }

/* classes: the row that holds a box and its button, the class code, the tables on My classes and a class's page */
.py-row { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1.5rem; }
.py-row .py-input { flex: 1; margin-bottom: 0; }
.py-row .py-btn { white-space: nowrap; padding: .65rem 1.1rem; }
.py-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.py-code-big { font-size: 1.4rem; font-weight: 700; margin-left: .5rem; }
.py-who-link { margin-right: 1rem; }
.py-wrong { color: #dc2626; font-weight: 600; }
.py-scroll { overflow-x: auto; }
.py-table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; }
.py-table th { text-align: left; font-size: .85rem; font-weight: 600; color: var(--text-secondary); padding: .4rem .8rem .4rem 0; border-bottom: 1px solid var(--border-color); }
.py-table td { padding: .6rem .8rem .6rem 0; border-bottom: 1px solid var(--border-color); }
.py-table th.n, .py-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.py-table td form { margin: 0; }
.py-btn-small { font-size: .85rem; font-weight: 400; padding: .25rem .7rem; }
.py-btn-danger { color: #dc2626; }
.py-school { display: flex; justify-content: space-between; gap: 1rem; width: 100%; font: inherit; font-weight: 700; text-align: left; color: var(--text-primary); background: none; border: 0; padding: .75rem 1rem; cursor: pointer; border-radius: 8px; }
.py-school:hover, .py-school:focus { background: var(--bg-tertiary); }

/* Check my work: the question mark beside a line, and the box it opens */
.why-btn { background: none; border: 0; padding: 0 .15rem; cursor: pointer; color: #60a5fa; font-size: 1em; }
.why-btn:hover, .why-btn:focus-visible { color: #bfdbfe; }
dialog.why { max-width: 30rem; padding: 1rem 1.2rem; border-radius: 8px; color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--border-color); }
dialog.why::backdrop { background: rgba(0, 0, 0, .6); }
dialog.why h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
dialog.why p { margin: 0 0 1rem; }
dialog.why form { text-align: right; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.py-btn:disabled { cursor: default; }
/* Sign out (includes/page.php py_sign_out_html): a form's button that looks like the link beside it; the teacher header's .ps-who a look is shell.css's */
.py-out-form { display: inline; margin: 0; }
.py-out { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: none; }

/* What a full account gives (full.php): the hero is D's mockup (its colours, type and button), with less padding
   as he asked; under it, tabs. */
body.fa-page { background: #0b0f2b; color: #ffffff; font-family: system-ui, 'Segoe UI', Roboto, sans-serif; line-height: normal; }
.fa-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 24px 28px; }
.fa-hero img { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; }
.fa-hero h1 { margin: 20px 0 8px; font-size: 52px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.fa-hero p { margin: 0; font-size: 20px; color: #b9bedb; }
.fa-hero .fa-cta { margin-top: 24px; }
.fa-cta { display: inline-block; padding: 16px 28px; border: 0; border-radius: 10px; background: #15803d; color: #ffffff; font: inherit; font-size: 18px; font-weight: 600; text-decoration: none; }
.fa-cta:not(:disabled) { cursor: pointer; }
.fa-cta:not(:disabled):hover { filter: brightness(1.12); }
.fa-cta:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
/* the tabs (D, 4 Oct 2026): Highlights first, then the full details in four groups. Underline tabs with a lighter
   full-width green line under the bar; the bar never moves (the scrollbar's space is kept, see html below). */
html:has(body.fa-page) { overflow-y: scroll; scrollbar-gutter: stable; }
.fa-tabs { max-width: 1040px; margin: 0 auto; padding: 0 24px 48px; }
.fa-tablist { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; border-bottom: 1px solid color-mix(in srgb, #4ade80 45%, transparent); }
.fa-tab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 12px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: #b9bedb; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.fa-tab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.fa-tab:hover { color: #ffffff; }
.fa-tab:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }
.fa-tab[aria-selected="true"] { color: #4ade80; border-bottom-color: #4ade80; }
.fa-panel[hidden] { display: none; }
.fa-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
@media (max-width: 760px) { .fa-rows { grid-template-columns: 1fr; } }
.fa-rows > div { padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.fa-rows h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.fa-rows h3 svg { flex: none; width: 22px; height: 22px; fill: none; stroke: #4ade80; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; } /* a highlight's own icon */
.fa-rows p { margin: 0; font-size: 16px; line-height: 1.5; color: #b9bedb; }
/* the full account page on the light page themes (Light, Cream, Yellow, Blue) and on High contrast: the theme's colours */
html.page-light body.fa-page, html.page-contrast body.fa-page { background: var(--bg-primary); color: var(--text-primary); }
html.page-light .fa-hero p, html.page-light .fa-rows p, html.page-light .fa-tab,
html.page-contrast .fa-hero p, html.page-contrast .fa-rows p, html.page-contrast .fa-tab { color: var(--text-secondary); }
html.page-contrast .fa-rows > div { border-bottom-color: var(--border-color); }
html.page-light .fa-tab:hover { color: var(--text-primary); }
html.page-light .fa-tab:focus-visible { outline-color: var(--text-primary); }
html.page-light .fa-tab[aria-selected="true"] { color: #15803d; border-bottom-color: #15803d; }
html.page-light .fa-tablist { border-bottom-color: color-mix(in srgb, #15803d 45%, transparent); }
html.page-light .fa-rows > div { border-bottom-color: var(--border-color); }
html.page-light .fa-rows h3 svg { stroke: #15803d; }

/* Class page: the join link a teacher gives out (14 Oct 2026) */
.py-link { width: 100%; max-width: 34rem; font-family: ui-monospace, monospace; font-size: .9rem; }

/* Homework on the pupil's home (D, 14 Oct 2026) */
.py-h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--text-secondary); }
.py-tick { color: #16a34a; font-weight: 700; font-size: 1.2rem; }
/* the demo's end (done.php): sign up, the /account/ buttons as they look there */
.py-signup-line { margin: 0 0 1rem; }
.py-signup .cn-signins { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto 1.5rem; }
.py-signup .btn.ms { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 15px 20px; font-size: 17px; font-weight: 600; line-height: 1;
    border-radius: 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-primary); text-decoration: none; }
.py-signup .btn.ms:hover { background: var(--bg-secondary); }
.py-signup .btn.ms svg { width: 18px; height: 18px; flex: none; }
