@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --ink: #f6f8f9;
  --muted: #8d9ba5;
  --cyan: #78e8ff;
  --cyan-bright: #19d5fa;
  --cyan-deep: #0e6174;
  --bg: #06090c;
  --panel: #0d1419;
  --panel-2: #111b22;
  --line: rgba(120, 232, 255, 0.18);
  --warm: #f3c979;
  --danger: #ff7a83;
  --radius: 22px;
  --shadow: 0 26px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(25, 213, 250, .10), transparent 30rem),
    linear-gradient(rgba(120,232,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,232,255,.025) 1px, transparent 1px), var(--bg);
  background-size: auto, 48px 48px, 48px 48px, auto;
  font-family: 'DM Sans', system-ui, sans-serif;
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(120,232,255,.55); outline-offset: 3px; }
img { max-width: 100%; }
.hidden { display: none !important; }
.eyebrow { color: var(--cyan); font: 800 .72rem/1 'Manrope', sans-serif; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(420px,.85fr); }
.login-visual { position: relative; overflow: hidden; padding: 58px clamp(32px,6vw,90px); display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-visual::after { content:""; position:absolute; width:640px; height:640px; border-radius:50%; border:1px solid var(--line); right:-230px; bottom:-210px; box-shadow: 0 0 0 78px rgba(120,232,255,.025), 0 0 0 156px rgba(120,232,255,.018); }
.brand { position:relative; z-index:1; display:flex; align-items:center; gap:14px; font:800 1rem 'Manrope'; letter-spacing:.12em; }
.brand img { width:52px; height:52px; border-radius:14px; object-fit:cover; background:#fff; }
.brand small { display:block; color:var(--muted); font:600 .62rem 'DM Sans'; letter-spacing:.11em; margin-top:4px; }
.login-copy { position:relative; z-index:1; max-width:760px; padding:80px 0 28px; }
.login-copy h1 { font:800 clamp(3.1rem,7vw,7rem)/.9 'Manrope'; letter-spacing:-.075em; margin:20px 0 28px; text-transform:uppercase; max-width:900px; }
.login-copy h1 span { color:var(--cyan); display:block; }
.login-copy p { color:#b2bec5; font-size:clamp(1rem,1.5vw,1.2rem); max-width:600px; line-height:1.7; }
.login-steps { display:flex; flex-wrap:wrap; gap:12px; margin-top:38px; }
.login-step { display:flex; align-items:center; gap:10px; color:#c7d1d6; font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; }
.login-step b { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; color:#001014; background:var(--cyan); }
.login-panel { background:rgba(13,20,25,.92); border-left:1px solid var(--line); display:grid; place-items:center; padding:36px; position:relative; z-index:2; }
.login-card { width:min(100%,460px); }
.login-card h2 { font:800 2.2rem 'Manrope'; letter-spacing:-.045em; margin:14px 0 8px; }
.login-card > p { color:var(--muted); margin:0 0 34px; line-height:1.55; }
.field { display:grid; gap:8px; margin-bottom:18px; }
.field label { font-weight:700; font-size:.83rem; color:#cbd4d9; }
.field input, .field select { width:100%; color:var(--ink); background:#081015; border:1px solid #24343e; border-radius:13px; padding:15px 16px; transition:.2s; }
.field input:focus, .field select:focus { border-color:var(--cyan); box-shadow:0 0 0 4px rgba(120,232,255,.08); }
.password-wrap { position:relative; }
.password-wrap input { padding-right:64px; }
.text-button { border:0; background:none; color:var(--cyan); font-weight:700; padding:5px; }
.password-wrap .text-button { position:absolute; right:10px; top:50%; transform:translateY(-50%); }
.primary { border:0; border-radius:999px; background:var(--cyan); color:#041116; font-weight:800; padding:14px 22px; box-shadow:0 10px 30px rgba(25,213,250,.17); transition:.2s; }
.primary:hover { background:#a1f0ff; transform:translateY(-2px); }
.secondary { border:1px solid #2a3e49; border-radius:999px; background:#111b22; color:var(--ink); font-weight:700; padding:13px 20px; transition:.2s; }
.secondary:hover { border-color:var(--cyan); color:var(--cyan); }
.theme-toggle { border:1px solid #273942; border-radius:999px; background:#101a20; color:var(--ink); padding:10px 14px; display:flex; align-items:center; gap:7px; font-weight:800; font-size:.78rem; transition:.2s; white-space:nowrap; }
.theme-toggle:hover { border-color:var(--cyan); color:var(--cyan); transform:translateY(-1px); }
.login-theme-toggle { position:absolute; top:28px; right:28px; }
.danger-button { color:var(--danger); border-color:rgba(255,122,131,.3); }
.login-card .primary { width:100%; margin-top:7px; }
.demo-credentials { margin-top:26px; padding:17px; border:1px dashed rgba(120,232,255,.28); border-radius:14px; background:rgba(120,232,255,.04); }
.demo-credentials span { display:block; color:var(--cyan); font-weight:800; font-size:.75rem; text-transform:uppercase; letter-spacing:.1em; margin-bottom:9px; }
.credential-row { display:flex; justify-content:space-between; gap:20px; color:#bec9cf; font-size:.84rem; margin-top:5px; }
.credential-row code { color:#fff; }
.login-error { color:#ffb0b5; min-height:22px; margin:10px 0 0; font-size:.86rem; }

.app-shell { min-height:100vh; }
.topbar { height:82px; position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:34px; padding:0 clamp(20px,4vw,64px); background:rgba(6,9,12,.87); backdrop-filter:blur(18px); border-bottom:1px solid rgba(120,232,255,.10); }
.topbar .brand { margin-right:auto; }
.topbar .brand img { width:42px; height:42px; border-radius:11px; }
.nav { display:flex; align-items:center; gap:4px; }
.nav button { border:0; background:transparent; color:#82919a; border-radius:999px; padding:10px 14px; font-weight:700; font-size:.86rem; }
.nav button:hover, .nav button.active { background:#12202a; color:var(--cyan); }
.profile-chip { display:flex; align-items:center; gap:10px; border:1px solid #23343e; background:#0d161c; border-radius:999px; padding:6px 11px 6px 6px; color:#dce3e6; }
.avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:var(--cyan); color:#041116; font-weight:900; }
.mobile-nav { display:none; }

.page { width:min(1440px,calc(100% - 40px)); margin:0 auto; padding:54px 0 90px; animation:fadeUp .45s ease; }
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } }
.page-heading { display:flex; justify-content:space-between; align-items:end; gap:30px; margin-bottom:34px; }
.page-heading h1 { font:800 clamp(2.2rem,5vw,4.5rem)/.98 'Manrope'; letter-spacing:-.065em; margin:10px 0 0; }
.page-heading p { max-width:510px; color:var(--muted); line-height:1.6; margin:0; }
.section-title { display:flex; justify-content:space-between; align-items:center; margin:52px 0 20px; }
.section-title h2 { font:800 clamp(1.35rem,2.4vw,2rem) 'Manrope'; letter-spacing:-.035em; margin:0; }
.link-button { background:none; border:0; color:var(--cyan); font-weight:800; }

.hero-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(280px,.6fr); gap:20px; }
.hero-card { min-height:410px; border:1px solid var(--line); border-radius:30px; overflow:hidden; position:relative; background:linear-gradient(135deg,#0e1c24,#081014 68%); display:flex; align-items:center; }
.hero-card::before { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(6,9,12,.95) 24%,rgba(6,9,12,.6) 58%,rgba(6,9,12,.14)), var(--book-image) center right/cover no-repeat; opacity:.88; }
.hero-content { position:relative; z-index:1; padding:clamp(28px,5vw,64px); width:min(650px,70%); }
.hero-content h1 { font:800 clamp(2.7rem,5vw,5.8rem)/.91 'Manrope'; letter-spacing:-.075em; margin:18px 0 20px; text-transform:uppercase; }
.hero-content p { color:#c0cbd0; line-height:1.65; max-width:530px; }
.hero-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:28px; }
.status-card { border:1px solid var(--line); border-radius:30px; background:var(--panel); padding:28px; display:flex; flex-direction:column; justify-content:space-between; }
.status-card h3 { font:800 1.25rem 'Manrope'; margin:8px 0 5px; }
.ring-wrap { display:grid; place-items:center; padding:20px 0; }
.progress-ring { width:170px; height:170px; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--cyan) var(--progress),#16242c 0); position:relative; }
.progress-ring::after { content:""; position:absolute; inset:12px; border-radius:50%; background:var(--panel); }
.progress-ring strong { position:relative; z-index:1; font:800 2.25rem 'Manrope'; }
.mini-stat-row { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.mini-stat { background:#111b22; padding:14px; border-radius:15px; }
.mini-stat strong { display:block; font:800 1.25rem 'Manrope'; }
.mini-stat span { color:var(--muted); font-size:.75rem; }

.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.stat { border:1px solid rgba(255,255,255,.07); background:var(--panel); border-radius:19px; padding:22px; }
.stat .icon { color:var(--cyan); font-size:1.25rem; }
.stat strong { display:block; font:800 2rem 'Manrope'; margin:19px 0 3px; }
.stat span { color:var(--muted); font-size:.82rem; }

.book-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.book-card { border:1px solid rgba(255,255,255,.08); border-radius:24px; overflow:hidden; background:var(--panel); transition:.25s; position:relative; }
.book-card:hover { transform:translateY(-7px); border-color:rgba(120,232,255,.4); box-shadow:var(--shadow); }
.book-cover { height:340px; background:#111; overflow:hidden; position:relative; }
.book-cover img { width:100%; height:100%; object-fit:cover; transition:.4s; }
.book-card:hover .book-cover img { transform:scale(1.035); }
.price-tag { position:absolute; top:15px; right:15px; border:1px solid rgba(255,255,255,.22); background:rgba(4,9,12,.82); backdrop-filter:blur(10px); border-radius:999px; padding:8px 12px; font-weight:800; }
.completed-tag { position:absolute; top:15px; left:15px; color:#031115; background:var(--cyan); border-radius:999px; padding:8px 12px; font-weight:800; font-size:.73rem; text-transform:uppercase; letter-spacing:.08em; }
.book-body { padding:22px; }
.book-body h3 { font:800 1.25rem/1.15 'Manrope'; margin:0 0 5px; }
.book-author { color:var(--muted); font-size:.84rem; }
.book-meta { display:flex; justify-content:space-between; gap:12px; align-items:center; margin:22px 0 14px; color:#acb7bd; font-size:.78rem; }
.progress-track { height:7px; border-radius:99px; background:#1b2931; overflow:hidden; }
.progress-fill { height:100%; border-radius:inherit; background:var(--cyan); transition:.35s; }
.book-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:20px; }
.book-actions button { padding:12px 9px; font-size:.82rem; }

.journey { display:grid; grid-template-columns:repeat(5,1fr); border:1px solid var(--line); border-radius:22px; overflow:hidden; background:var(--panel); }
.journey-step { padding:25px 22px; min-height:148px; border-right:1px solid var(--line); position:relative; }
.journey-step:last-child { border:0; }
.journey-step b { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#16313a; color:var(--cyan); margin-bottom:18px; }
.journey-step strong { display:block; font:800 .82rem 'Manrope'; text-transform:uppercase; letter-spacing:.08em; }
.journey-step span { color:var(--muted); font-size:.76rem; display:block; margin-top:7px; line-height:1.4; }

.library-toolbar { display:flex; gap:12px; align-items:center; margin-bottom:26px; }
.search { flex:1; position:relative; }
.search input { width:100%; padding:15px 18px 15px 46px; background:var(--panel); border:1px solid #22343e; border-radius:999px; color:#fff; }
.search span { position:absolute; left:18px; top:50%; transform:translateY(-50%); color:var(--muted); }
.filter-pills { display:flex; gap:8px; }
.filter-pills button { border:1px solid #23343e; background:var(--panel); color:var(--muted); border-radius:999px; padding:12px 16px; font-weight:700; }
.filter-pills button.active { color:#021115; background:var(--cyan); border-color:var(--cyan); }

.rewards-hero { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.wallet-card { min-height:280px; border-radius:28px; background:linear-gradient(135deg,#6fe6ff,#0eb8da); color:#041116; padding:34px; position:relative; overflow:hidden; }
.wallet-card::after { content:'MGM'; position:absolute; right:-15px; bottom:-46px; font:900 8rem 'Manrope'; letter-spacing:-.1em; opacity:.10; }
.wallet-card h2 { font:800 1rem 'Manrope'; text-transform:uppercase; letter-spacing:.11em; }
.wallet-card .points { font:800 clamp(3.5rem,7vw,6rem)/1 'Manrope'; letter-spacing:-.07em; margin:35px 0 5px; }
.wallet-card p { max-width:350px; color:#0b4d59; }
.tier-card { border:1px solid var(--line); border-radius:28px; background:var(--panel); padding:34px; }
.tier-card h2 { font:800 1.8rem 'Manrope'; margin:12px 0 8px; }
.tier-progress { margin:36px 0 20px; }
.tier-labels { display:flex; justify-content:space-between; font-weight:800; font-size:.78rem; margin-bottom:10px; }
.reward-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.reward-card { border:1px solid rgba(255,255,255,.08); border-radius:22px; background:var(--panel); min-height:440px; display:flex; flex-direction:column; position:relative; overflow:hidden; }
.reward-card.locked .reward-visual img { filter:grayscale(1) contrast(.78); opacity:.58; }
.reward-visual { height:210px; position:relative; overflow:hidden; background:#dce3e6; }
.reward-visual::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 55%,rgba(5,9,12,.48)); }
.reward-visual img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .5s ease, filter .3s; }
.reward-card:hover .reward-visual img { transform:scale(1.04); }
.reward-state { position:absolute; z-index:1; right:14px; top:14px; padding:7px 10px; border-radius:999px; color:#031115; background:var(--cyan); font:800 .66rem 'Manrope'; letter-spacing:.09em; }
.reward-card.locked .reward-state { color:#e4ebee; background:rgba(5,9,12,.76); backdrop-filter:blur(8px); }
.reward-card-content { flex:1; display:flex; flex-direction:column; padding:22px 24px 24px; }
.reward-card .reward-icon { width:50px; height:50px; border-radius:15px; display:grid; place-items:center; font-size:1.45rem; background:#16313a; }
.reward-card h3 { font:800 1.25rem/1.2 'Manrope'; margin:20px 0 8px; }
.reward-card p { color:var(--muted); line-height:1.5; margin:0; font-size:.86rem; }
.reward-card p strong { color:#dfe7ea; }
.reward-card footer { margin-top:auto; padding-top:20px; }
.voucher-code { border:1px dashed #31505e; border-radius:10px; padding:11px; text-align:center; color:var(--cyan); font:800 .83rem 'Manrope'; letter-spacing:.1em; }
.locked-label { color:var(--muted); font-weight:800; font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; }

.profile-layout { display:grid; grid-template-columns:330px 1fr; gap:20px; }
.profile-card { background:var(--panel); border:1px solid var(--line); border-radius:25px; padding:28px; }
.profile-main { text-align:center; }
.profile-main .avatar { width:96px; height:96px; margin:10px auto 20px; font-size:2.2rem; box-shadow:0 0 0 8px #11232c; }
.profile-main h2 { font:800 1.6rem 'Manrope'; margin:0; }
.profile-main p { color:var(--muted); margin:6px 0; }
.level-badge { display:inline-block; margin:13px 0 24px; padding:7px 11px; border-radius:999px; color:var(--cyan); background:#15303a; font-weight:800; font-size:.75rem; }
.profile-detail { border-top:1px solid rgba(255,255,255,.08); padding:15px 0; display:flex; justify-content:space-between; font-size:.84rem; }
.profile-detail span { color:var(--muted); }
.profile-content { display:grid; gap:20px; }
.analytics-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.chart-card { background:var(--panel); border:1px solid rgba(255,255,255,.08); border-radius:25px; padding:28px; }
.chart-head { display:flex; justify-content:space-between; align-items:center; }
.chart-head h3 { font:800 1.2rem 'Manrope'; margin:0; }
.bars { height:220px; display:flex; gap:12px; align-items:end; margin-top:28px; border-bottom:1px solid #26343c; }
.bar-col { height:100%; flex:1; display:flex; flex-direction:column; justify-content:end; align-items:center; gap:9px; color:var(--muted); font-size:.72rem; }
.bar { width:min(35px,80%); min-height:4px; border-radius:8px 8px 0 0; background:linear-gradient(var(--cyan),#12829b); transition:.5s; }
.activity-list { display:grid; gap:4px; margin-top:20px; }
.activity { display:grid; grid-template-columns:38px 1fr auto; gap:13px; align-items:center; padding:13px 0; border-bottom:1px solid rgba(255,255,255,.06); }
.activity:last-child { border:0; }
.activity-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:#14262f; }
.activity strong { display:block; font-size:.86rem; }
.activity span { color:var(--muted); font-size:.76rem; }
.activity time { color:#667681; font-size:.72rem; }

.footer { border-top:1px solid rgba(255,255,255,.08); padding:26px clamp(20px,4vw,64px) 34px; display:flex; justify-content:space-between; align-items:center; gap:20px; color:#687680; font-size:.78rem; }
.footer-actions { display:flex; gap:8px; align-items:center; }
.footer button { padding:9px 13px; font-size:.74rem; }

.modal-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:center; background:rgba(0,0,0,.78); backdrop-filter:blur(10px); padding:20px; animation:fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; } }
.modal { width:min(560px,100%); max-height:90vh; overflow:auto; background:#0e171d; border:1px solid #29414d; border-radius:26px; box-shadow:var(--shadow); padding:30px; position:relative; }
.modal.wide { width:min(980px,100%); }
.modal-close { position:absolute; right:18px; top:18px; width:38px; height:38px; border:1px solid #2a3b45; border-radius:50%; color:#fff; background:#142027; }
.modal h2 { font:800 1.8rem 'Manrope'; letter-spacing:-.04em; margin:10px 40px 10px 0; }
.modal > p { color:var(--muted); line-height:1.55; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:26px; }
.order-summary { display:grid; grid-template-columns:82px 1fr auto; gap:16px; align-items:center; padding:17px; background:#111d24; border-radius:17px; margin:23px 0; }
.order-summary img { width:82px; height:100px; object-fit:cover; border-radius:9px; }
.order-summary strong { display:block; }
.order-summary span { color:var(--muted); font-size:.82rem; }
.order-summary b { color:var(--cyan); font-size:1.25rem; }
.success-mark { width:80px; height:80px; display:grid; place-items:center; margin:12px auto 24px; background:var(--cyan); color:#041116; border-radius:50%; font-size:2.4rem; }
.center { text-align:center; }
.reward-reveal { height:230px; margin:22px 0; border-radius:18px; overflow:hidden; position:relative; border:1px solid var(--line); box-shadow:0 20px 50px rgba(0,0,0,.22); }
.reward-reveal img { width:100%; height:100%; object-fit:cover; }
.reward-reveal span { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); color:#031115; background:var(--cyan); border-radius:999px; padding:8px 13px; font:800 .68rem 'Manrope'; letter-spacing:.11em; white-space:nowrap; }

.reader-overlay { position:fixed; inset:0; z-index:90; background:#050709; overflow:auto; }
.reader-topbar { height:74px; position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:0 clamp(18px,4vw,52px); background:rgba(5,7,9,.93); border-bottom:1px solid rgba(255,255,255,.08); backdrop-filter:blur(15px); }
.reader-title { min-width:0; }
.reader-title strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reader-title span { color:var(--muted); font-size:.76rem; }
.reader-layout { min-height:calc(100vh - 74px); display:grid; grid-template-columns:270px 1fr; }
.reader-aside { padding:38px 30px; background:#091015; border-right:1px solid rgba(255,255,255,.07); }
.reader-aside img { width:100%; aspect-ratio:4/5; object-fit:cover; border-radius:15px; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.reader-pages-nav { margin-top:30px; display:grid; gap:9px; }
.page-dot { border:1px solid #23333c; background:#0e181e; color:var(--muted); border-radius:12px; padding:12px; text-align:left; display:flex; align-items:center; gap:10px; }
.page-dot b { width:24px; height:24px; display:grid; place-items:center; border-radius:50%; background:#1b2c35; font-size:.7rem; }
.page-dot.active { color:var(--cyan); border-color:#277288; }
.page-dot.active b { background:var(--cyan); color:#051116; }
.reader-stage { display:grid; place-items:center; padding:clamp(24px,5vw,70px); background:radial-gradient(circle at 50% 40%,#16232b,#070b0e 70%); perspective:1800px; overflow:hidden; }
.book-page { width:min(760px,100%); min-height:680px; color:#172024; background:linear-gradient(90deg,#e4ddcf 0,#f5efe4 7%,#f0eadf 100%); border-radius:5px 18px 18px 5px; box-shadow:25px 30px 70px rgba(0,0,0,.45), inset 18px 0 30px rgba(87,64,35,.12), inset -2px 0 rgba(255,255,255,.7); padding:clamp(36px,7vw,85px); position:relative; transform-origin:left center; transform-style:preserve-3d; backface-visibility:hidden; }
.book-page::before { content:""; position:absolute; top:12px; right:-7px; bottom:12px; width:8px; border-radius:0 7px 7px 0; background:repeating-linear-gradient(90deg,#c7beae 0 1px,#f3ecdf 1px 2px); box-shadow:4px 2px 8px rgba(0,0,0,.16); }
.book-page::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; background:linear-gradient(100deg,rgba(255,255,255,.18),transparent 18%,transparent 75%,rgba(91,67,41,.07)); mix-blend-mode:multiply; }
.page-turn-out-next { animation:pageTurnOutNext .34s cubic-bezier(.55,.05,.67,.19) forwards; }
.page-turn-in-next { animation:pageTurnInNext .5s cubic-bezier(.22,.61,.36,1); }
.page-turn-out-prev { animation:pageTurnOutPrev .34s cubic-bezier(.55,.05,.67,.19) forwards; transform-origin:right center; }
.page-turn-in-prev { animation:pageTurnInPrev .5s cubic-bezier(.22,.61,.36,1); transform-origin:right center; }
@keyframes pageTurnOutNext { 0% { transform:rotateY(0); filter:brightness(1); } 55% { box-shadow:5px 24px 30px rgba(0,0,0,.36); } 100% { transform:rotateY(-86deg) translateX(-4%); filter:brightness(.75); opacity:.2; } }
@keyframes pageTurnInNext { 0% { transform:rotateY(72deg) translateX(5%); filter:brightness(.7); opacity:.25; } 100% { transform:rotateY(0); filter:brightness(1); opacity:1; } }
@keyframes pageTurnOutPrev { 0% { transform:rotateY(0); } 100% { transform:rotateY(86deg) translateX(4%); filter:brightness(.75); opacity:.2; } }
@keyframes pageTurnInPrev { 0% { transform:rotateY(-72deg) translateX(-5%); filter:brightness(.7); opacity:.25; } 100% { transform:rotateY(0); filter:brightness(1); opacity:1; } }
.page-number { color:#776f63; font:700 .76rem 'Manrope'; letter-spacing:.12em; text-transform:uppercase; }
.book-page h1 { font:800 clamp(2.5rem,5vw,4.2rem)/1 'Manrope'; letter-spacing:-.065em; margin:50px 0 22px; color:#0c1518; }
.book-page .lead { font:600 1.2rem/1.6 'Manrope'; color:#354248; }
.book-page p { font:400 1rem/1.85 'DM Sans'; color:#3e474a; }
.pull-quote { border-left:4px solid #0d91ad; margin:34px 0; padding:12px 0 12px 24px; font:700 1.25rem/1.5 'Manrope'; color:#18333a; }
.reflection { margin-top:36px; border-top:1px solid #c3bbaa; padding-top:22px; }
.reflection strong { display:block; color:#0f6778; margin-bottom:6px; }
.reader-controls { position:absolute; left:clamp(28px,6vw,70px); right:clamp(28px,6vw,70px); bottom:28px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.reader-controls button { min-width:110px; }
.reader-progress { flex:1; max-width:300px; text-align:center; color:#59666c; font-weight:700; font-size:.78rem; }
.reader-progress .progress-track { background:#d6cfc2; margin-top:8px; }
.reader-progress .progress-fill { background:#0d91ad; }

.confetti { position:fixed; inset:0; z-index:150; pointer-events:none; overflow:hidden; }
.confetti i { position:absolute; top:-20px; width:10px; height:18px; background:var(--c); left:var(--x); animation:fall var(--d) linear forwards; transform:rotate(var(--r)); }
@keyframes fall { to { transform:translateY(110vh) rotate(720deg); } }
#toast-region { position:fixed; right:20px; bottom:22px; z-index:200; display:grid; gap:10px; }
.toast { min-width:280px; max-width:380px; background:#12212a; color:#fff; border:1px solid #2a5462; border-radius:14px; padding:15px 18px; box-shadow:var(--shadow); animation:toastIn .25s ease; }
.toast strong { color:var(--cyan); display:block; margin-bottom:3px; }
@keyframes toastIn { from { opacity:0; transform:translateY(12px); } }

.page-splash { position:fixed; inset:0; z-index:300; display:grid; place-content:center; justify-items:center; gap:14px; color:var(--ink); background:rgba(6,9,12,.94); backdrop-filter:blur(24px); opacity:0; visibility:hidden; transition:opacity .25s ease,visibility .25s; }
.page-splash.active { opacity:1; visibility:visible; }
.page-splash.leaving { opacity:0; }
.splash-orbit { width:96px; height:96px; border:1px solid rgba(120,232,255,.34); border-radius:50%; display:grid; place-items:center; position:relative; margin-bottom:10px; }
.splash-orbit::after { content:""; position:absolute; inset:-8px; border-radius:50%; border-top:2px solid var(--cyan); border-right:2px solid transparent; animation:splashSpin .8s linear infinite; }
.splash-orbit img { width:58px; height:58px; object-fit:cover; border-radius:15px; background:#fff; }
.page-splash strong { font:800 clamp(1.35rem,3vw,2rem) 'Manrope'; letter-spacing:-.035em; }
.splash-line { width:180px; height:3px; border-radius:999px; overflow:hidden; background:#1b2a32; margin-top:9px; }
.splash-line i { display:block; width:45%; height:100%; border-radius:inherit; background:var(--cyan); animation:splashLoad .8s ease-in-out infinite; }
@keyframes splashSpin { to { transform:rotate(360deg); } }
@keyframes splashLoad { 0% { transform:translateX(-110%); } 100% { transform:translateX(330%); } }

[data-theme="light"] { --ink:#142027; --muted:#667680; --bg:#eef3f4; --panel:#ffffff; --panel-2:#f4f8f9; --line:rgba(5,118,143,.18); --shadow:0 24px 70px rgba(27,55,65,.14); }
[data-theme="light"] body { background:radial-gradient(circle at 80% -10%,rgba(25,213,250,.15),transparent 30rem),linear-gradient(rgba(13,112,134,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(13,112,134,.045) 1px,transparent 1px),var(--bg); background-size:auto,48px 48px,48px 48px,auto; }
[data-theme="light"] .login-panel,
[data-theme="light"] .topbar { background:rgba(250,253,253,.9); }
[data-theme="light"] .login-panel { border-color:rgba(13,112,134,.16); }
[data-theme="light"] .login-visual { background:linear-gradient(135deg,#f8fbfc,#dceff2); }
[data-theme="light"] .login-copy p,
[data-theme="light"] .credential-row,
[data-theme="light"] .book-author { color:#576872; }
[data-theme="light"] .field input,
[data-theme="light"] .field select { color:#142027; background:#f8fbfc; border-color:#cbd9de; }
[data-theme="light"] .secondary,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .profile-chip,
[data-theme="light"] .filter-pills button { color:#203039; background:#f7fafb; border-color:#c9d8dd; }
[data-theme="light"] .nav button:hover,
[data-theme="light"] .nav button.active { background:#dff4f7; }
[data-theme="light"] .hero-card { background:#dcebee; }
[data-theme="light"] .hero-card::before { background:linear-gradient(90deg,rgba(246,250,251,.98) 24%,rgba(246,250,251,.76) 58%,rgba(246,250,251,.08)),var(--book-image) center right/cover no-repeat; }
[data-theme="light"] .hero-content p { color:#40525b; }
[data-theme="light"] .stat,
[data-theme="light"] .book-card,
[data-theme="light"] .chart-card,
[data-theme="light"] .reward-card { border-color:rgba(13,112,134,.13); box-shadow:0 10px 28px rgba(35,65,75,.04); }
[data-theme="light"] .mini-stat,
[data-theme="light"] .activity-icon { background:#eaf2f4; }
[data-theme="light"] .journey-step b,
[data-theme="light"] .reward-card .reward-icon { background:#d9f0f4; }
[data-theme="light"] .reward-card p strong { color:#21333c; }
[data-theme="light"] .profile-card { background:#fff; }
[data-theme="light"] .mobile-nav { background:rgba(250,253,253,.96); }
[data-theme="light"] .reader-overlay { background:#dfe6e8; }
[data-theme="light"] .reader-topbar { background:rgba(249,252,252,.94); }
[data-theme="light"] .reader-aside { background:#e9eff1; }
[data-theme="light"] .page-dot { background:#f8fbfc; border-color:#cbd8dc; }
[data-theme="light"] .reader-stage { background:radial-gradient(circle at 50% 40%,#dbe6e9,#bbc8cd 75%); }
[data-theme="light"] .page-splash { background:rgba(239,245,246,.96); }
[data-theme="light"] .modal { background:#f8fbfc; }
[data-theme="light"] .modal-close { background:#e8f0f2; color:#142027; }
[data-theme="light"] .order-summary { background:#eaf1f3; }
[data-theme="light"] .toast { background:#f8fbfc; color:#142027; }

@media (max-width: 1050px) {
  .login-shell { grid-template-columns:1fr 420px; }
  .login-copy h1 { font-size:clamp(3rem,6vw,5.4rem); }
  .nav { display:none; }
  .topbar > .theme-toggle span { display:none; }
  .mobile-nav { display:grid; grid-template-columns:repeat(5,1fr); position:fixed; left:12px; right:12px; bottom:12px; z-index:50; background:rgba(13,20,25,.96); border:1px solid #253843; border-radius:18px; padding:7px; backdrop-filter:blur(16px); box-shadow:0 20px 50px #000; }
  .mobile-nav button { border:0; background:transparent; color:var(--muted); padding:8px 4px; border-radius:12px; font-size:.66rem; font-weight:700; }
  .mobile-nav button span { display:block; font-size:1.15rem; margin-bottom:2px; }
  .mobile-nav button.active { color:var(--cyan); background:#14242c; }
  .footer { padding-bottom:100px; }
  .book-cover { height:290px; }
  .reader-layout { grid-template-columns:1fr; }
  .reader-aside { display:none; }
}

@media (max-width: 780px) {
  .login-shell { grid-template-columns:1fr; }
  .login-visual { min-height:auto; padding:28px 24px 38px; }
  .login-copy { padding:72px 0 10px; }
  .login-copy h1 { font-size:3.25rem; }
  .login-copy p { font-size:.95rem; }
  .login-steps { display:none; }
  .login-panel { border:0; border-top:1px solid var(--line); padding:38px 24px 54px; }
  .login-theme-toggle { top:18px; right:18px; }
  .topbar { height:70px; padding:0 18px; }
  .topbar .brand div { display:none; }
  .profile-chip span { display:none; }
  .page { width:min(100% - 28px,1440px); padding:35px 0 70px; }
  .page-heading { display:block; }
  .page-heading p { margin-top:16px; }
  .hero-grid, .rewards-hero, .profile-layout { grid-template-columns:1fr; }
  .hero-card { min-height:500px; align-items:end; }
  .hero-card::before { background:linear-gradient(0deg,rgba(6,9,12,.98) 20%,rgba(6,9,12,.3) 75%),var(--book-image) center/cover no-repeat; }
  .hero-content { width:100%; padding:28px; }
  .hero-content h1 { font-size:3.4rem; }
  .stat-grid, .analytics-grid { grid-template-columns:repeat(2,1fr); }
  .book-grid, .reward-grid { grid-template-columns:1fr; }
  .book-card { display:grid; grid-template-columns:130px 1fr; }
  .book-cover { height:100%; min-height:280px; }
  .book-actions { grid-template-columns:1fr; }
  .journey { grid-template-columns:1fr; }
  .journey-step { border-right:0; border-bottom:1px solid var(--line); min-height:auto; }
  .library-toolbar { align-items:stretch; flex-direction:column; }
  .filter-pills { overflow:auto; padding-bottom:3px; }
  .footer { align-items:flex-start; flex-direction:column; }
  .book-page { min-height:calc(100vh - 118px); padding:42px 30px 120px; }
  .reader-stage { padding:22px 0 0; display:block; }
  .reader-controls { left:24px; right:24px; bottom:24px; }
  .reader-controls button { min-width:80px; padding:11px 13px; }
  .modal { padding:24px; }
}

@media (max-width: 500px) {
  .book-card { grid-template-columns:108px 1fr; }
  .book-cover { min-height:300px; }
  .book-body { padding:17px 14px; }
  .book-meta { display:block; }
  .book-meta span { display:block; margin-top:5px; }
  .credential-row { display:block; }
  .credential-row code { display:block; margin-top:3px; }
  .order-summary { grid-template-columns:65px 1fr; }
  .order-summary img { width:65px; height:84px; }
  .order-summary b { grid-column:2; }
  .page-heading h1 { font-size:2.75rem; }
}

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