/* P4.AV: learner sign-in page. Colours --brand, --brand-hover, --brand-soft, --deep, --glow come from the site's
   branding settings (set in the page); everything else is here. Light and dark follow the device. */
:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #5b6474;
    --line: #e3e7ef;
    --field: #ffffff;
    --field-line: #cfd6e2;
    --ok: #15803d;
    --bad: #b42318;
    --warn: #b45309;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 32px -12px rgba(15, 23, 42, .18);
    --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1020;
        --card: #121a2e;
        --ink: #e8edf7;
        --muted: #9aa6bb;
        --line: #24304a;
        --field: #0e1527;
        --field-line: #33415f;
        --ok: #4ade80;
        --bad: #f87171;
        --warn: #fbbf24;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.p4av {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.p4av a { color: var(--brand); }
@media (prefers-color-scheme: dark) { .p4av .panel a { color: #93c5fd; } }
.skip { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff !important; padding: .6rem 1rem; border-radius: 0 0 10px 0; z-index: 10; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 1fr); min-height: 100vh; }

/* ---------- left: the story */
.story {
    position: relative; overflow: hidden; color: #fff; padding: 40px clamp(32px, 5vw, 72px);
    display: flex; flex-direction: column; gap: 32px;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, .10), transparent 60%), linear-gradient(150deg, var(--brand) 0%, var(--deep) 78%);
}
.story a { color: #fff; }
.orbs span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: drift 22s var(--ease) infinite alternate; }
.orbs span:nth-child(1) { width: 420px; height: 420px; background: var(--glow); top: -120px; right: -100px; }
.orbs span:nth-child(2) { width: 320px; height: 320px; background: #a78bfa; bottom: -120px; left: -80px; animation-duration: 26s; opacity: .3; }
.orbs span:nth-child(3) { width: 220px; height: 220px; background: #22d3ee; top: 45%; left: 55%; animation-duration: 30s; opacity: .22; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-40px, 30px, 0) scale(1.12); } }
.story > *:not(.orbs) { position: relative; z-index: 1; }
.story-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 700; font-size: 1.15rem; }
.brand-logo { height: 44px; width: auto; max-width: 220px; object-fit: contain; }
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); font-weight: 800; letter-spacing: .02em; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); transition: background .2s; }
.back:hover { background: rgba(255, 255, 255, .22); }
.story-main { margin-top: auto; max-width: 560px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; opacity: .85; margin: 0 0 12px; }
.story-title { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: clamp(2.1rem, 3.6vw, 3.25rem); line-height: 1.08; font-weight: 800; margin: 0 0 16px; letter-spacing: -.02em; }
.hl { color: #fff; background: linear-gradient(transparent 76%, rgba(255, 255, 255, .28) 76%, rgba(255, 255, 255, .28) 90%, transparent 90%); }
.story-lead { font-size: 1.08rem; opacity: .9; margin: 0 0 28px; max-width: 46ch; }
.stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.stats li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.stats i { opacity: .9; }
.stats strong { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { opacity: .88; font-size: .92rem; }

.showcase { margin-top: auto; max-width: 560px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); border-radius: 18px; padding: 14px; backdrop-filter: blur(8px); }
.showcase-head { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; opacity: .9; padding: 2px 4px 10px; }
.pause { background: rgba(255, 255, 255, .15); color: #fff; border: 0; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.pause:hover { background: rgba(255, 255, 255, .28); }
.slides { position: relative; min-height: 86px; }
.slide { display: flex; gap: 14px; align-items: center; text-decoration: none; padding: 6px; border-radius: 12px; animation: slidein .5s var(--ease); }
.slide:hover { background: rgba(255, 255, 255, .08); }
.slide[hidden] { display: none; }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.thumb { flex: 0 0 104px; height: 72px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .15); display: grid; place-items: center; font-size: 1.4rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slide-cat { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.slide-text strong { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 1.02rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slide-meta { font-size: .85rem; opacity: .82; }
.dots { display: flex; gap: 8px; padding: 10px 4px 2px; }
.dot { width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s var(--ease), background .3s; }
.dot.is-on { width: 26px; background: #fff; }
.dot::after { content: ""; display: block; margin: -10px; padding: 14px; } /* a larger target to tap */

/* ---------- right: the form */
.panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px clamp(20px, 4vw, 56px); gap: 18px; }
.panel-top { display: none; }
.card {
    width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
    padding: clamp(24px, 3vw, 40px); box-shadow: var(--shadow); animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.title { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-size: 1.75rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(10deg); } }
.sub { color: var(--muted); margin: 0 0 22px; }

.messages:empty { display: none; }
.messages { display: grid; gap: 10px; margin-bottom: 18px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .93rem; border: 1px solid; animation: rise .35s var(--ease) both; }
.note i { margin-top: 3px; }
.note span { flex: 1; }
.note a { font-weight: 600; }
.note-success { background: #ecfdf3; border-color: #abefc6; color: #05603a; }
.note-warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.note-danger { background: #fef3f2; border-color: #fecdca; color: #912018; }
.note-info { background: #eff8ff; border-color: #b2ddff; color: #194185; }
@media (prefers-color-scheme: dark) {
    .note-success { background: #052e1a; border-color: #14532d; color: #bbf7d0; }
    .note-warning { background: #2e1d05; border-color: #713f12; color: #fde68a; }
    .note-danger { background: #2d0b0b; border-color: #7f1d1d; color: #fecaca; }
    .note-info { background: #0b1d33; border-color: #1e3a5f; color: #bfdbfe; }
}
.note-x { background: none; border: 0; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; opacity: .7; padding: 0 2px; }
.note-x:hover { opacity: 1; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.field { margin-bottom: 16px; }
.field label, .label-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.link-small { font-size: .86rem; font-weight: 600; text-decoration: none; }
.link-small:hover { text-decoration: underline; }
.control { position: relative; }
.control input {
    width: 100%; height: 50px; padding: 0 46px 0 44px; border-radius: 12px; border: 1.5px solid var(--field-line);
    background: var(--field); color: var(--ink); font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s, background .2s;
}
.control input::placeholder { color: #8a94a6; }
.control input:hover { border-color: #a9b3c4; }
.control input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 22%, transparent); }
.lead-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #8a94a6; transition: color .2s; pointer-events: none; }
.control:focus-within .lead-icon { color: var(--brand); }
.ok-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%) scale(.6); color: var(--ok); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.field.is-ok .ok-icon { opacity: 1; transform: translateY(-50%) scale(1); }
.field.is-bad input { border-color: var(--bad); }
.field.is-bad input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 18%, transparent); }
.msg { min-height: 0; margin: 6px 2px 0; font-size: .86rem; color: var(--bad); }
.msg:empty { display: none; }
.caps { margin: 6px 2px 0; font-size: .86rem; color: var(--warn); font-weight: 600; }
.reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: #8a94a6; border-radius: 10px; cursor: pointer; }
.reveal:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }

.row-between { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .93rem; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--field-line); display: grid; place-items: center; background: var(--field); transition: background .15s, border-color .15s; }
.check .box i { font-size: .7rem; color: #fff; transform: scale(0); transition: transform .15s var(--ease); }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box i { transform: scale(1); }
.check input:focus-visible + .box { outline: 3px solid var(--glow); outline-offset: 2px; }
.info { position: relative; background: none; border: 0; color: var(--muted); cursor: help; width: 32px; height: 32px; border-radius: 50%; }
.info .tip { position: absolute; right: 0; bottom: calc(100% + 8px); width: 230px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--card); font-size: .82rem; text-align: left; line-height: 1.4; opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s; z-index: 5; }
.info:hover .tip, .info:focus .tip { opacity: 1; visibility: visible; transform: none; }

.primary {
    position: relative; width: 100%; height: 52px; border: 0; border-radius: 12px; cursor: pointer; overflow: hidden;
    background: var(--brand); color: #fff; font: 600 1.02rem Inter, sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 10px 22px -10px var(--glow); transition: background .2s, transform .15s, box-shadow .2s;
}
.primary:hover { background: var(--brand-hover); }
.primary:active { transform: translateY(1px) scale(.995); }
.primary .btn-arrow { transition: transform .2s var(--ease); }
.primary:hover .btn-arrow { transform: translateX(3px); }
.primary .spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
.primary.is-busy { cursor: progress; }
.primary.is-busy .btn-arrow { display: none; }
.primary.is-busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.socials { display: grid; gap: 10px; }
.social { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border-radius: 12px; border: 1.5px solid var(--field-line); background: var(--field); color: var(--ink) !important; text-decoration: none; font-weight: 600; transition: border-color .2s, background .2s, transform .15s; }
.social:hover { border-color: #a9b3c4; background: color-mix(in srgb, var(--ink) 3%, var(--field)); }
.social.is-busy { opacity: .7; pointer-events: none; }
.signup { text-align: center; margin: 22px 0 0; color: var(--muted); }
.signup a { font-weight: 700; text-decoration: none; }
.signup a:hover { text-decoration: underline; }
.doors, .legal { font-size: .86rem; color: var(--muted); margin: 0; text-align: center; }
.doors a, .legal a { font-weight: 600; }

/* ---------- tablet and phone */
@media (max-width: 1023px) {
    .shell { grid-template-columns: 1fr; }
    .story { padding: 22px 20px 26px; gap: 18px; }
    .story-top .back, .showcase, .story-lead { display: none; }
    .story-main { margin-top: 0; }
    .story-title { font-size: 1.7rem; margin-bottom: 14px; }
    .eyebrow { margin-bottom: 6px; }
    .stats li { padding: 8px 12px; }
    .stats strong { font-size: 1.1rem; }
    .panel { justify-content: flex-start; padding: 0 16px 32px; }
    .card { margin-top: -14px; border-radius: 18px; }
}
@media (max-width: 480px) {
    .stats { gap: 8px; }
    .stats li { flex: 1 1 auto; justify-content: center; }
    .stats i { display: none; }
    .brand-logo { height: 36px; }
    .card { padding: 22px 18px; }
    .title { font-size: 1.5rem; }
    .info .tip { right: -8px; width: 210px; }
}
/* P4.AX: the logo rounded, framed, with a soft glow in the brand colour (sign-in and registration pages) */
.p4av .brand-logo {
    height: 52px; border-radius: 14px; padding: 6px 10px; border: 1.5px solid rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 0 26px -2px var(--glow);
    transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.p4av .brand:hover .brand-logo { box-shadow: 0 0 0 4px rgba(255, 255, 255, .1), 0 0 34px 2px var(--glow); transform: translateY(-1px); }
.p4av .brand-small .brand-logo { border-color: var(--line); background: var(--card); box-shadow: 0 0 18px -4px var(--glow); }
.p4av .brand-mark { border-radius: 14px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 0 24px -2px var(--glow); }
.p4av .brand-small .brand-mark { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 480px) { .p4av .brand-logo { height: 44px; } }

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