/* =====================================================================================
   Base styles shared by every page (calendar, PDF Downloader, video downloader).
   Page-specific styles live next to each page (e.g. /calendar/calendar.css).
   ===================================================================================== */

/* ---------- Colour tokens (light, then dark when the device prefers it) ---------- */
:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #16181d; --muted: #646b78; --border: #e2e5ec;
  --accent: #e5322d; --accent-2: #2d6be5; --ok: #1f9d55; --err: #c62828; --input: #fbfcfe;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #181b21; --text: #eceef2; --muted: #9aa1ad; --border: #2a2f38;
          --input: #12151a; --ok: #3ecf7c; --err: #ff6b6b; }
}

/* ---------- Page layout and text ---------- */
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
       background: var(--bg); color: var(--text); }
main { max-width: 720px; margin: 0 auto; padding: 40px 16px 64px; }
h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.02em; }
.sub { color: var(--muted); margin: 0 0 28px; }

/* ---------- Cards (the white boxes) ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
        padding: 22px; margin-bottom: 20px; }
.card h2 { font-size: 18px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.card p.hint { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Form fields and buttons ---------- */
input[type=url], input[type=text], select { width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
        background: var(--input); border: 1px solid var(--border); border-radius: 10px; }
input[type=url]:focus, input[type=text]:focus, select:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
button { font: inherit; font-weight: 600; padding: 12px 16px; border: 0; border-radius: 10px;
         cursor: pointer; color: #fff; background: var(--accent); }
button.blue { background: var(--accent-2); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button:disabled { opacity: .55; cursor: progress; }

/* ---------- Download status line, progress bar and spinner ---------- */
.status { margin-top: 14px; font-size: 14px; min-height: 1.5em; color: var(--muted);
          display: flex; gap: 8px; align-items: flex-start; word-break: break-word; }
.status.ok { color: var(--ok); } .status.err { color: var(--err); } .status.warn { color: #b7791f; }
.progress { height: 8px; margin-top: 14px; border-radius: 99px; background: var(--border); overflow: hidden; position: relative; }
.progress[hidden] { display: none; }
.progress .fill { height: 100%; width: 0; background: var(--accent-2); border-radius: 99px; transition: width .2s; }
.progress.indeterminate .fill { width: 35%; position: absolute; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { left: -35%; } to { left: 100%; } }
.spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent-2);
        border-radius: 50%; animation: s 0.8s linear infinite; flex: none; margin-top: 2px; }
@keyframes s { to { transform: rotate(360deg); } }

/* ---------- Footer, author line ---------- */
footer { color: var(--muted); font-size: 13px; text-align: center; }
.author { color: var(--muted); font-size: 12px; margin: 2px 0 6px; letter-spacing: .02em; }

/* ---------- PDF Downloader: "already downloaded" notice and "Scan again" ---------- */
.saved { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
         background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.saved[hidden] { display: none; }
button.link { background: none; color: var(--accent-2); padding: 0; font-weight: 600; text-decoration: underline; }

/* ---------- Text link to another page (e.g. "← EMBA (2026-28) Calendar") ---------- */
a.navlink { display: inline-block; margin: 0 0 18px; font-size: 14px; font-weight: 600; color: var(--accent-2); text-decoration: none; }
a.navlink:hover { text-decoration: underline; }
