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

/* Brand tokens — overwritten at runtime from site_settings.colors */
:root {
  --primary: #6D3BE8;
  --primary-ink: #FFFFFF;
  --bg: #FFFFFF;
  --surface: #F6F4FB;
  --ink: #14121A;
  --muted: #6B6680;
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --danger: #C62828;
  --ok: #2E7D32;
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 0; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; }
.field input {
  min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; background: var(--bg); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.hint { color: var(--muted); font-size: 14px; }

.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--surface); }
.card {
  width: 100%; max-width: 420px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 28px;
}
.card h1 { font-size: 22px; margin: 16px 0 6px; }
.card .brand { justify-content: center; font-size: 18px; }

.notice { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-top: 14px; }
.notice.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.notice.err { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }

.page-title { font-size: 26px; margin: 32px 0 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 20px 0 48px; }
.course-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.course-card .cover { aspect-ratio: 16/9; background: var(--surface); object-fit: cover; width: 100%; }
.course-card .body { padding: 16px; display: grid; gap: 10px; flex: 1; }
.progress { height: 6px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; margin: 20px 0; }

.device-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.device-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
