/* Cloud Pathshala Mock Tests — site styles */
:root {
  --blue: #1f7ae0; --blue-d: #0d4f96; --blue-l: #eaf3ff; --orange: #ff7a18; --ink: #16202b; --muted: #5d6b7a;
  --line: #dfe6ee; --bg: #f5f8fc; --card: #ffffff; --green: #1f9d55; --red: #d64545; --amber: #d98b00; --purple: #6c3fb0;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 4px 16px rgba(16, 32, 64, .06);
  font-family: 'Inter', 'Segoe UI', Roboto, 'Noto Sans', system-ui, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.hidden { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand small { display: block; font-weight: 600; color: var(--orange); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a.on, .nav a:hover { background: var(--blue-l); color: var(--blue-d); text-decoration: none; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); display: grid; place-items: center; font-weight: 800; font-size: .8rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
main.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
@media (max-width: 720px) { .nav { display: none; } .user-chip .uname { display: none; } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: .92rem; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn:hover { border-color: #c4d0de; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: #fff; border-color: #f0c4c4; color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue-d); }
.btn.sm { padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 4px 8px; }
label.f { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border: 1px solid #cdd7e2; border-radius: 9px; font: inherit; color: var(--ink); background: #fff; }
.input:focus { outline: 2px solid #b9d6fb; border-color: var(--blue); }
textarea.input { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card.pad0 { padding: 0; }
.item { display: grid; gap: 10px; align-content: start; }
.item .cover { height: 120px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), var(--blue-d)); background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 10px; color: #fff; font-weight: 800; }
.item h3 { margin: 0; }
.price { display: flex; gap: 8px; align-items: baseline; font-weight: 800; font-size: 1.15rem; }
.price s { color: var(--muted); font-weight: 500; font-size: .9rem; }
.price .off { color: var(--green); font-size: .8rem; font-weight: 700; }
.pricebox { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; font-size: .92rem; }
.pricebox .pr { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pricebox .pr s { color: var(--muted); }
.pricebox .disc { color: var(--green); font-weight: 600; }
.pricebox .disc b { font-size: .78rem; background: #e3f6ec; color: #13703c; border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.pricebox .fin { border-top: 1px dashed var(--line); padding-top: 5px; margin-top: 2px; font-weight: 800; }
.pricebox .fin b { font-size: 1.2rem; color: var(--ink, #16202b); }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--blue-l); color: var(--blue-d); }
.tag.green { background: #e3f6ec; color: #13703c; } .tag.orange { background: #fff0e4; color: #b4530a; } .tag.red { background: #fde8e8; color: #a12f2f; } .tag.grey { background: #eef1f4; color: #55606c; }
.section-h { display: flex; align-items: end; gap: 10px; margin: 28px 0 12px; }
.section-h h2 { margin: 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.hero { background: linear-gradient(120deg, var(--blue-d), var(--blue)); color: #fff; border-radius: 16px; padding: 26px; display: grid; gap: 6px; }
.hero h1 { margin: 0; }
.hero p { margin: 0; opacity: .92; }

/* tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8fafc; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: #fafcff; }

/* stats */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: #edf1f6; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.bar.g i { background: var(--green); } .bar.r i { background: var(--red); } .bar.o i { background: var(--orange); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--blue-d); border-bottom-color: var(--blue); }

/* modal & toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: 90vh; display: grid; grid-template-rows: auto 1fr auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; flex: 1; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: #1d2733; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: .9rem; z-index: 200; transition: transform .25s; max-width: 90vw; }
.toast.show { transform: translate(-50%, 0); }
.toast.warn { background: #8a4b00; } .toast.err { background: #a12f2f; } .toast.ok { background: #13703c; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); padding: 30px; }
.spin { width: 22px; height: 22px; border: 3px solid #d7e3f1; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.auth { max-width: 420px; margin: 30px auto; }
.auth .or { text-align: center; color: var(--muted); font-size: .85rem; margin: 6px 0; }
.gbtn { display: flex; gap: 10px; align-items: center; justify-content: center; }

/* question content (shared by result + admin preview) */
.qtext { font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.qtext img { max-width: 100%; height: auto; vertical-align: middle; }
.qtext .katex-display { overflow-x: auto; overflow-y: hidden; }
.qtbl { border-collapse: collapse; margin: 6px 0; }
.qtbl td { border: 1px solid #aab; padding: 4px 8px; }
.opt-list { display: grid; gap: 6px; margin-top: 10px; }
.opt-row { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; align-items: flex-start; }
.opt-row .l { font-weight: 800; width: 22px; flex: none; }
.opt-row.key { border-color: #9fd9b6; background: #effaf3; }
.opt-row.mine.wrong { border-color: #f2b8b8; background: #fdf1f1; }
.opt-row.clickable { cursor: pointer; }
.sol { background: #f8fafc; border-left: 3px solid var(--blue); padding: 10px 12px; border-radius: 6px; margin-top: 10px; }
.passage { background: #f7f9fc; border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; }

/* AI analysis */
.ai { border: 1px solid #d6e6fb; background: linear-gradient(180deg, #f6faff, #fff); }
.ai h3 { display: flex; gap: 8px; align-items: center; }
.ai ul { margin: 6px 0 12px; padding-left: 20px; }
.ai li { margin: 4px 0; }
.prio { font-size: .7rem; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin-right: 6px; }
.prio.high { background: #fde8e8; color: #a12f2f; } .prio.medium { background: #fff0e4; color: #b4530a; } .prio.low { background: #e3f6ec; color: #13703c; }

/* review palette chips */
.qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchip { width: 36px; height: 32px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; cursor: pointer; border: 1px solid var(--line); background: #fff; }
.qchip.c { background: #e3f6ec; border-color: #9fd9b6; color: #13703c; } .qchip.w { background: #fde8e8; border-color: #f2b8b8; color: #a12f2f; }
.qchip.p { background: #fff0e4; border-color: #f6c79e; color: #b4530a; } .qchip.b { background: #ece6f8; color: var(--purple); }
.qchip.on { outline: 2px solid var(--ink); }

/* admin */
.admin-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.admin-q.warn { border-color: #f4c27a; background: #fffaf2; }
.admin-q .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; font-size: .8rem; }
.warnbox { background: #fff6e8; border: 1px solid #f4c27a; color: #7a4a00; border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.drop { border: 2px dashed #b9cde4; border-radius: 12px; padding: 18px; text-align: center; background: #f8fbff; color: var(--muted); }
.drop.over { background: var(--blue-l); border-color: var(--blue); }
footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 16px; }

/* folder tree (series) */
.tree-f { border-left: 3px solid #cfe0f6; padding: 6px 0 6px 10px; margin: 6px 0; }
.tree-c { margin-left: 18px; }
.tree-t { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tree-t:last-child { border-bottom: 0; }
.folder > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.folder[open] > summary::before { transform: rotate(90deg); }
.folder .folder { margin-left: 16px; border-left: 3px solid #e3edf9; }
.folder { border-bottom: 1px solid var(--line); }
.folder:last-child { border-bottom: 0; }

/* test series opened like Google Drive: path on top, folder tiles, then the tests */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 1.05rem; margin-bottom: 12px; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.crumbs a:hover { background: var(--blue-l); color: var(--blue-d); }
.crumbs b { padding: 4px 8px; }
.crumbs .sep { color: var(--muted); }
.crumbs .drive-up { border: 1px solid var(--line); background: #fff; font-weight: 700; padding: 4px 11px; margin-right: 4px; }
.drive-h { font-size: .82rem; font-weight: 700; color: var(--muted); margin: 14px 2px 8px; }
.drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.drive-f { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #f0f4f9; border: 1px solid transparent; color: #444746; text-decoration: none; min-width: 0; }
.drive-f:hover, .drive-f:focus-visible { background: #e1e9f3; border-color: #c8d6e8; }
.drive-f svg { flex: none; color: #5f6368; }
.drive-n { display: grid; min-width: 0; }
.drive-n b { color: var(--ink, #16202b); overflow-wrap: anywhere; line-height: 1.25; }
.drive-n small { color: var(--muted); }
@media (max-width: 520px) { .crumbs { font-size: .95rem; gap: 2px; } .crumbs a, .crumbs b { padding: 4px 5px; } .drive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .drive-f { padding: 12px; gap: 8px; } .drive-n b { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; } }
