/* Nav dropdowns as small menus (elements/nav.php), and the Help menu. Loaded by nav.php itself, so it applies on every page.
   Scoped to header.mbm so these rules win over the older .panel rules in site.css (body.skills, body.home).
   Positioning under each tab, and the Help menu, are in js/nav.js. */

/* ---- small menus: Primary, Secondary, A Level, Tutors/Parents ---- */
header.mbm .panel.mini{width:320px;padding:8px;border-radius:18px;box-shadow:0 24px 50px -24px rgba(20,26,46,.45)}
/* a small arrow on the top edge, pointing up at the tab; js/nav.js sets --ax (the tab's centre, from the menu's left edge) and
   places the menu 10px under the tab, which leaves room for it */
header.mbm .panel.mini::before{content:"";position:absolute;top:-7px;left:calc(var(--ax,50%) - 6px);width:12px;height:12px;background:#fff;border-top:1px solid rgba(20,26,46,.16);border-left:1px solid rgba(20,26,46,.16);border-radius:3px 0 0 0;box-shadow:-2px -2px 4px -2px rgba(20,26,46,.12);transform:rotate(45deg)}
header.mbm .panel.mini a{display:block;margin:0;padding:10px 12px;border-radius:12px;background:none;color:var(--fg);text-decoration:none;font-weight:400}
header.mbm .panel.mini a:hover{background:rgba(128,128,128,.1);color:var(--fg)}
header.mbm .panel.mini a.cur{background:rgba(128,128,128,.08)}
header.mbm .panel.mini b{display:block;font-size:15px;font-weight:600;color:var(--fg)}
header.mbm .panel.mini a:hover b{color:#000}
header.mbm .panel.mini small{display:block;margin-top:1px;color:var(--mut);font-size:13px;font-weight:400;line-height:1.4}
/* ---- the dropdown menus (.panel.dd2, elements/nav.php): columns, then a grey subscribe bar ----
   Left: plain rows (bold name with an optional badge, a short line under it), light grey on hover. Then What's included and
   Courses as plain link lists, each column with a thin rule on its left. .three = three columns (Secondary, A Level), .solo =
   the left column only (Tutors/Parents). Every rule starts header.mbm .panel.mini.dd2 so it wins over the .panel.mini styles above */
header.mbm .panel.mini.dd2{width:min(580px,calc(100vw - 32px));padding:10px;border:1px solid #e6e8ee;border-radius:22px;box-shadow:0 30px 60px -28px rgba(20,26,46,.45)}
header.mbm .panel.mini.dd2.three{width:min(850px,calc(100vw - 32px))}
/* .two (Primary): What's included as two columns of links, heading and "Topics covered →" across both */
header.mbm .panel.mini.dd2.two{width:min(720px,calc(100vw - 32px))}
header.mbm .panel.mini.dd2.two .dd-col{display:grid;grid-template-columns:auto auto;justify-content:start;column-gap:28px;align-content:start}
header.mbm .panel.mini.dd2.two .dd-col h4,header.mbm .panel.mini.dd2.two .dd-col a.dd-all{grid-column:1/-1}
header.mbm .panel.mini.dd2.solo{width:300px}
header.mbm .panel.mini.dd2.solo .dd-main{padding:0}
/* Tutors/Parents has no subscribe bar, so a little less space under the rows */
header.mbm .panel.mini.dd2.solo .dd-cols{padding-bottom:0}
/* two columns (Primary): a wider first column, What's included just wide enough for its short links */
header.mbm .panel.mini.dd2 .dd-cols{display:grid;grid-template-columns:310px minmax(0,1fr);padding:4px 0 6px}
header.mbm .panel.mini.dd2.three .dd-cols{grid-template-columns:310px minmax(0,1fr) minmax(0,1fr)} /* 310px: "Question Generator" and its Popular badge on one line, as on Primary */
header.mbm .panel.mini.dd2.solo .dd-cols{grid-template-columns:minmax(0,1fr)}
/* left (site.css still has an older .dd-main as two columns with padding, so it is reset here) */
header.mbm .panel.mini.dd2 .dd-main{display:flex;flex-direction:column;gap:2px;padding:0 10px 0 0}
header.mbm .panel.mini.dd2 a.dd-row{display:block;margin:0;padding:11px 12px;border-radius:12px;background:none;transition:background .15s}
header.mbm .panel.mini.dd2 a.dd-row:hover{background:#f4f5f8}
header.mbm .panel.mini.dd2 a.dd-row.cur{background:none}
/* "Why MathsBox for …": a light outlined box, a touch of space below it before the other rows */
header.mbm .panel.mini.dd2 a.dd-row.why{margin-bottom:6px;border:1px solid #e3e6ec;background:#fafbfc}
header.mbm .panel.mini.dd2 a.dd-row.why:hover{border-color:#cfd4dd;background:#f4f5f8}
header.mbm .panel.mini.dd2 a.dd-row b{display:flex;align-items:center;gap:8px;font-size:15.5px;font-weight:600;color:#141a2e}
header.mbm .panel.mini.dd2 a.dd-row small{margin-top:2px;font-size:13px;color:#646b7a}
/* the rows under "Why MathsBox" (Free resources, Question Generator…) get the same → as the column links, on the right of the
   name; it darkens and nudges right on hover */
header.mbm .panel.mini.dd2 a.dd-row:not(.why) b::after{content:"\002192";margin-left:auto;padding-left:12px;font-weight:400;color:#9aa1af;transition:transform .15s,color .15s}
header.mbm .panel.mini.dd2 a.dd-row:not(.why):hover b::after{color:#000;transform:translateX(3px)}
/* badges: Popular in the site blue, Free in a bright mustard yellow (as the .fx-badge.yellow) */
header.mbm .panel.mini.dd2 .dd-bdg{padding:2px 8px;border-radius:999px;background:#3d5afe;font-style:normal;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#fff}
header.mbm .panel.mini.dd2 .dd-bdg.free{background:#ffc928;color:#141a2e}
/* What's included and Courses: plain links */
header.mbm .panel.mini.dd2 .dd-col{display:flex;flex-direction:column;align-items:flex-start;padding:6px 22px 4px;border-left:1px solid #eceef2}
header.mbm .panel.mini.dd2 .dd-col h4{margin:0 0 10px;font-size:12px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#646b7a}
header.mbm .panel.mini.dd2 .dd-col a{display:block;margin:0;padding:6px 0;border-radius:0;background:none;font-size:15px;font-weight:400;color:#374151;transition:color .15s}
header.mbm .panel.mini.dd2 .dd-col a:hover{background:none;color:#000;text-decoration:underline;text-decoration-color:rgba(20,26,46,.3);text-decoration-thickness:1.5px;text-underline-offset:4px}
/* a small arrow after each plain link so they read as links; it darkens and nudges right on hover ("Topics covered →" has its own) */
header.mbm .panel.mini.dd2 .dd-col a:not(.dd-all)::after{content:"\002192";display:inline-block;margin-left:6px;color:#9aa1af;text-decoration:none;transition:transform .15s,color .15s}
header.mbm .panel.mini.dd2 .dd-col a:not(.dd-all):hover::after{color:#000;transform:translateX(3px)}
header.mbm .panel.mini.dd2 .dd-col a.cur{background:none;color:#000;font-weight:600}
header.mbm .panel.mini.dd2 .dd-col .dd-bdg{margin-left:8px;vertical-align:1px}
header.mbm .panel.mini.dd2 .dd-col a.dd-all{margin-top:10px;font-weight:700;color:#141a2e}
/* the subscribe bar: light grey, the offer in bold and who it covers on the left, a dark Subscribe button on the right */
header.mbm .panel.mini.dd2 .dd-foot{display:flex;align-items:center;gap:16px;margin:6px 0 0;padding:14px 14px 14px 18px;border-radius:14px;background:#f4f5f8}
header.mbm .panel.mini.dd2 .dd-foot b{display:block;font-size:15.5px;font-weight:600;color:#141a2e}
header.mbm .panel.mini.dd2 .dd-foot small{margin-top:2px;font-size:13px;color:#646b7a}
header.mbm .panel.mini.dd2 .dd-foot a{display:inline-flex;align-items:center;flex:none;margin:0 0 0 auto;height:40px;padding:0 18px;border-radius:999px;background:#23252f;font-size:14.5px;font-weight:700;color:#fff;white-space:nowrap;transition:background .15s}
header.mbm .panel.mini.dd2 .dd-foot a:hover{background:#000;color:#fff}
@media (prefers-reduced-motion:reduce){header.mbm .panel.mini.dd2 a.dd-row,header.mbm .panel.mini.dd2 .dd-col a,header.mbm .panel.mini.dd2 .dd-col a::after,header.mbm .panel.mini.dd2 a.dd-row b::after,header.mbm .panel.mini.dd2 .dd-foot a{transition:none}}

/* ---- Help: the ? button and its menu ---- */
header.mbm .hwrap{display:flex}
header.mbm button.nicon{cursor:pointer;padding:0;font:inherit}
header.mbm button.nicon[aria-expanded="true"]{background:rgba(20,26,46,.08)}header.mbm .hmenu{display:none;position:absolute;right:28px;top:calc(100% + 8px);width:290px;padding:8px;background:#fff;border:1px solid rgba(128,128,128,.18);border-radius:18px;box-shadow:0 24px 50px -24px rgba(20,26,46,.45);z-index:60}
header.mbm .hmenu.open{display:block}
/* the little arrow on top of the Help menu, as on the tab menus (.panel.mini::before), under the middle of the Help button:
   js/nav.js centres the menu under the button and sets --ar to the button's middle, measured from the menu's right edge */
header.mbm .hmenu::before{content:"";position:absolute;top:-7px;right:calc(var(--ar,18px) - 6px);width:12px;height:12px;background:#fff;border-top:1px solid rgba(20,26,46,.16);border-left:1px solid rgba(20,26,46,.16);border-radius:3px 0 0 0;box-shadow:-2px -2px 4px -2px rgba(20,26,46,.12);transform:rotate(45deg)}
header.mbm .hmenu a{display:block;padding:10px 12px;border-radius:12px;color:var(--fg);text-decoration:none}
header.mbm .hmenu a:hover{background:rgba(128,128,128,.1)}
header.mbm .hmenu b{display:block;font-size:15px;font-weight:600}
header.mbm .hmenu a:hover b{color:#000}
header.mbm .hmenu small{display:block;margin-top:1px;color:var(--mut);font-size:13px;line-height:1.4}
header.mbm .hmenu .hm-c{margin-top:6px;border-top:1px solid rgba(128,128,128,.18);border-radius:0 0 12px 12px;padding-top:14px}
/* a Help menu item that isn't ready yet (Resource guides): not a link, greyed, with a small grey Coming soon badge */
header.mbm .hmenu .hm-soon{display:block;padding:10px 12px;border-radius:12px;color:var(--fg);cursor:default}
header.mbm .hmenu .hm-soon b{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;color:#8a91a1}
header.mbm .hmenu .hm-soon small{color:#868d9b}
header.mbm .hmenu .hm-soon em{padding:2px 8px;border-radius:999px;background:#eef0f4;font-style:normal;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#5b6275}
/* Contact us at the top of the Help menu, with a rule under it */
header.mbm .hmenu .hm-t{position:relative;margin-bottom:13px;padding-right:56px}
/* the mail icon on the right of Contact us: no tile, just the outline */
header.mbm .hmenu .hm-ic{position:absolute;right:12px;top:50%;display:grid;place-items:center;width:30px;height:30px;margin-top:-15px;color:#141a2e}
header.mbm .hmenu .hm-ic svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
header.mbm .hmenu .hm-t::after{content:"";position:absolute;left:12px;right:12px;bottom:-7px;border-top:1px solid rgba(128,128,128,.18)}

/* ---- phones: menus sit inline in the mobile menu ---- */
@media (max-width:1024px){
 header.mbm .panel.mini,header.mbm .panel.mini.dd2,header.mbm .panel.mini.dd2.two,header.mbm .panel.mini.dd2.three,header.mbm .panel.mini.dd2.solo{width:auto;padding:0 0 8px;border:0;border-radius:0;box-shadow:none}
 header.mbm .panel.mini.dd2 .dd-cols,header.mbm .panel.mini.dd2.three .dd-cols{grid-template-columns:minmax(0,1fr)}
 header.mbm .panel.mini.dd2 .dd-main{padding:0}
 header.mbm .panel.mini.dd2 .dd-col{margin-top:8px;padding:12px 12px 0;border-left:0;border-top:1px solid #eceef2}
 header.mbm .panel.mini.dd2 .dd-foot{flex-wrap:wrap}
 header.mbm .panel.mini.dd2 .dd-foot a{margin-left:0}
 header.mbm .panel.mini::before{display:none}
 /* Renew and Help side by side on one row, as two matching buttons; the Help menu opens full width under them,
    then Log In and See plans full width */
 header.mbm nav .side{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 header.mbm .hwrap{display:contents}
 header.mbm nav .side>*:not(.renew){grid-column:1/-1}
 header.mbm nav .side>.renew,header.mbm button.nicon{grid-column:auto;display:flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;box-sizing:border-box;border:1px solid rgba(20,26,46,.16);border-radius:10px;background:#fff;font-size:14px;font-weight:700;color:#141a2e}
 header.mbm .hmenu{grid-column:1/-1;position:static;width:auto;margin-top:0;box-shadow:none}
 header.mbm .hmenu::before{display:none}
}

/* ==================== the login form (was css/loginform.css): the nav's Log In dropdown (elements/login-form.php) and login.php ==================== */
/* The login form (.mb-login): used twice, with the same fields and look.
   - the Log In dropdown in the nav (elements/nav.php, #loginMenu; opened by js/nav.js). nav.php loads this file, so it is on every page
   - the full login page (login.php), inside a card
   Both post to login.php, which does the login. */

.mb-login{--ink:#141a2e;--mut:#5b6275;--line:#d9dce4;font-family:inherit;color:var(--ink);text-align:left}
.mb-login .ml-h{display:block;margin:0 0 2px;font-size:18px;font-weight:800;letter-spacing:-.01em;color:var(--ink)}
.mb-login .ml-sub{margin:0 0 16px;font-size:13.5px;line-height:1.45;color:var(--mut)}
.mb-login label.ml-l{display:block;margin:12px 0 6px;font-size:13.5px;font-weight:700;color:var(--ink)}
.mb-login label.ml-l:first-of-type{margin-top:0}
.mb-login input.ml-in{display:block;width:100%;box-sizing:border-box;height:44px;margin:0;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:#fff;font:inherit;font-size:15.5px;color:var(--ink);transition:border-color .15s,box-shadow .15s}
.mb-login input.ml-in::placeholder{color:#9aa0ad}
.mb-login input.ml-in:focus{outline:none;border-color:var(--ink);box-shadow:0 0 0 3px rgba(20,26,46,.08)}
/* password with a show/hide eye inside it */
.mb-login .ml-pw{position:relative}
.mb-login .ml-pw input.ml-in{padding-right:46px}
.mb-login .ml-eye{position:absolute;right:6px;top:50%;display:flex;align-items:center;justify-content:center;width:34px;height:34px;margin:-17px 0 0;padding:0;border:0;border-radius:9px;background:none;color:#6b7284;cursor:pointer}
.mb-login .ml-eye:hover{background:#f1f2f6;color:var(--ink)}
.mb-login .ml-eye:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
.mb-login .ml-eye svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mb-login .ml-eye .ml-hide,.mb-login .ml-eye[aria-pressed="true"] .ml-show{display:none}
.mb-login .ml-eye[aria-pressed="true"] .ml-hide{display:block}
/* remember me, and the forgotten-password link on the same line */
.mb-login .ml-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 0;font-size:13.5px}
.mb-login label.ml-rem{display:inline-flex;align-items:center;gap:8px;margin:0;font-weight:500;color:var(--ink);cursor:pointer}
.mb-login label.ml-rem input{width:17px;height:17px;margin:0;accent-color:#3d5afe;cursor:pointer}
.mb-login .ml-row a{color:var(--mut);font-weight:600;text-decoration:none;white-space:nowrap}
.mb-login .ml-row a:hover{color:var(--ink);text-decoration:underline}
/* error from a failed login (login.php only) */
.mb-login .ml-err{display:flex;gap:10px;align-items:flex-start;margin:0 0 16px;padding:11px 14px;border:1px solid #f3c2c2;border-radius:12px;background:#fdf1f1;font-size:14px;line-height:1.45;color:#a52222}
.mb-login .ml-err svg{flex:none;width:18px;height:18px;margin-top:1px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.mb-login .ml-err a{color:inherit;font-weight:700}
/* the Log in button: the site's dark pill, full width */
.mb-login button.ml-go{display:flex;align-items:center;justify-content:center;width:100%;height:46px;margin:18px 0 0;padding:0 18px;border:0;border-radius:999px;background:#3d5afe;font:inherit;font-size:15.5px;font-weight:700;color:#fff;cursor:pointer;transition:background .15s}
.mb-login button.ml-go:hover{background:#2c47e0}
.mb-login button.ml-go:focus-visible{outline:2px solid #3d5afe;outline-offset:2px}
/* greyed out until both fields are filled in (the script in elements/login-form.php) */
.mb-login button.ml-go:disabled{background:#c9cdd6;color:#fff;cursor:not-allowed}
/* a field clicked into and left empty: red border (only after the user has touched it) */
.mb-login input.ml-in:user-invalid{border-color:#d93b3b;box-shadow:0 0 0 3px rgba(217,59,59,.1)}
/* new to MathsBox: a light grey bar under the form */
.mb-login .ml-new{margin:16px 0 0;padding:12px 14px;border-radius:12px;background:#f4f5f8;font-size:13.5px;text-align:center;color:var(--mut)}
.mb-login .ml-new a{font-weight:700;color:var(--ink);text-decoration:none;white-space:nowrap}
.mb-login .ml-new a:hover{text-decoration:underline}
@media (prefers-reduced-motion:reduce){.mb-login input.ml-in,.mb-login button.ml-go{transition:none}}

/* ---- the Log In dropdown in the nav: hangs from the bar under the Log In button, like the Help menu ---- */
header.mbm .lwrap{position:static;display:flex}
header.mbm .nlog{cursor:pointer}
/* the Santa hat on the Log In button's top-right corner, tipped over to the right (elements/nav.php, $navXmasHat) */
.nlog{position:relative}
.nlog-hat{position:absolute;top:-11px;right:-10px;width:26px;height:auto;transform:rotate(20deg);filter:drop-shadow(0 1px 1px rgba(20,26,46,.08));pointer-events:none;transition:transform .25s cubic-bezier(.3,1.4,.5,1)}
.nlog:hover .nlog-hat{transform:rotate(27deg) translateY(-1px)}
@media (prefers-reduced-motion:reduce){.nlog-hat{transition:none}}
header.mbm .nlog[aria-expanded="true"]{background:rgba(20,26,46,.08)}
header.mbm .lmenu{display:none;position:absolute;right:28px;top:calc(100% + 8px);width:340px;box-sizing:border-box;padding:20px;background:#fff;border:1px solid #e6e8ee;border-radius:20px;box-shadow:0 30px 60px -28px rgba(20,26,46,.45);z-index:61}
header.mbm .lmenu.open{display:block}
/* a small arrow on the top edge pointing up at the Log In button, as on the other nav menus; js/nav.js sets --ar
   (the button's centre, measured from the menu's right edge) */
header.mbm .lmenu::before{content:"";position:absolute;top:-7px;right:calc(var(--ar,40px) - 6px);width:12px;height:12px;background:#fff;border-top:1px solid #e6e8ee;border-left:1px solid #e6e8ee;border-radius:3px 0 0 0;box-shadow:-2px -2px 4px -2px rgba(20,26,46,.12);transform:rotate(45deg)}
@media (max-width:1024px){
 header.mbm .lwrap{flex-direction:column}
 header.mbm .lmenu{position:static;width:auto;margin-top:8px;padding:16px;box-shadow:none}
 header.mbm .lmenu::before{display:none}
}
