/* Sign-in / sign-up, student panel, lesson player and exams. Builds on academy.css tokens. */
[hidden] { display: none !important; }

/* ===== Auth ===== */
.auth-wrap { padding-block: 40px 10px; }
.auth-card { display: grid; grid-template-columns: 0.9fr 1.1fr; max-width: 980px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -40px rgba(var(--light-rgb), .55); }
.auth-hello { position: relative; overflow: hidden; color: #fff; padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; background: linear-gradient(150deg, #4b3f8f, #7c6cc4 58%, #c0718a); }
.auth-hello::after { content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 3l7 20 20 7-20 7-7 20-7-20L3 30l20-7z' fill='none' stroke='%23fff'/%3E%3C/svg%3E"); }
.auth-hello::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; pointer-events: none; }
.auth-hello > * { position: relative; z-index: 1; }
.logo-plate { align-self: flex-start; background: rgba(255,255,255,.94); border-radius: 60px 60px 16px 16px; padding: 16px 22px 12px; box-shadow: 0 16px 30px -18px rgba(36,31,58,.6); }
.logo-plate img { display: block; height: 120px; width: auto; }
.auth-hello .ayah-sm { font-family: var(--font-naskh); font-size: 19px; opacity: .92; }
.auth-hello h1 { font-family: var(--font-kufi); font-size: 25px; line-height: 1.6; }
.auth-hello p { opacity: .9; font-size: 14px; }
.perks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.perks .icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(255,255,255,.16); flex: none; }

.auth-body { padding: 26px 30px 28px; min-width: 0; }
.auth-body .tabs { margin-top: 0; }
.tabs a { flex: 1; text-align: center; font: 600 15px var(--font-body); color: var(--muted); padding: 12px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--emerald); border-bottom-color: var(--emerald); }
.tabs a:hover { color: var(--ink); }
.role-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; border: 0; padding: 0; }
.role-row legend { float: inline-start; margin-inline-end: 8px; padding: 0; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; border-radius: 999px; padding: 5px 16px; font: 500 13px var(--font-body); color: var(--muted); transition: all .2s; }
.seg input:checked + span { background: var(--emerald); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--light); outline-offset: 2px; }
.seg input:disabled + span { opacity: .45; cursor: not-allowed; }
.admin-link { margin-inline-start: auto; font-size: 12px; border: 1px dashed var(--line); border-radius: 999px; padding: 3px 12px; color: var(--muted); }
.admin-link:hover { color: var(--ink); border-color: var(--ink); }

.form { display: grid; gap: 14px; margin-top: 20px; }
.form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fld { display: grid; gap: 5px; min-width: 0; }
.fld > label, .fld > .lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.fld > label small, .fld > .lbl small { color: var(--muted); font-weight: 400; }
.fld .field { padding: 9px 12px; background: var(--bg); }
.fld .field input, .fld .field select { width: 100%; flex: 1; font-size: 14.5px; }
.fld .field select { cursor: pointer; }
.fld .field .icon { color: var(--muted); width: 17px; height: 17px; }
.fld input[dir="ltr"] { text-align: right; }
.fld input[dir="ltr"]:placeholder-shown { direction: rtl; }
.eye { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 6px; }
.eye:hover { color: var(--emerald); }
.err { font-size: 12.5px; color: #a24a66; }
.fld.bad .field { border-color: var(--brick); background: rgba(192,113,138,.05); }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.link { color: var(--emerald); font-size: 13px; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.link:hover { text-decoration: underline; }
.submit { width: 100%; padding-block: 12px; font-size: 15px; border-radius: 12px; }
.gender { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; }
.gender label { flex: 1; cursor: pointer; position: relative; }
.gender input { position: absolute; opacity: 0; pointer-events: none; }
.gender span { display: block; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 14px; background: var(--bg); transition: all .2s; }
.gender input:checked + span { border-color: var(--emerald); color: var(--emerald); background: rgba(var(--light-rgb), .06); font-weight: 600; }
.gender input:focus-visible + span { outline: 2px solid var(--light); outline-offset: 2px; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.agree input { accent-color: var(--emerald); width: 16px; height: 16px; margin-top: 5px; flex: none; }
.teacher-extra { display: grid; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.notice { display: flex; gap: 10px; font-size: 13px; line-height: 1.9; color: var(--ink); background: rgba(192,113,138,.08); border: 1px solid rgba(192,113,138,.3); border-radius: 12px; padding: 10px 12px; }
.notice .icon { color: var(--brick); margin-top: 3px; }
.notice.calm { background: rgba(var(--light-rgb), .06); border-color: var(--line); }
.notice.calm .icon { color: var(--emerald); }
.notice.bad { color: #a24a66; }
.hint { font-size: 13px; color: var(--muted); text-align: center; }
.demo-line { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

@media (max-width: 820px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-hello { padding: 26px 22px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
  .logo-plate { padding: 10px 14px 8px; }
  .logo-plate img { height: 84px; }
  .auth-hello .hello-text { flex: 1; min-width: 180px; }
  .auth-hello h1 { font-size: 21px; }
  .perks { width: 100%; }
}
@media (max-width: 560px) {
  .auth-wrap { padding-top: 20px; }
  .auth-body { padding: 18px 16px 22px; }
  .form .row-2 { grid-template-columns: 1fr; }
  .seg span { padding: 5px 12px; }
  .admin-link { margin-inline-start: 0; }
}

/* ===== Student panel ===== */
.empty.sm { padding: 26px 14px; font-size: 14px; line-height: 1.9; }
.empty .btn { margin-top: 10px; padding: 6px 16px; font-size: 13px; }
td.empty-cell { padding: 0 !important; border: 0 !important; }
td.empty-cell .empty { margin: 4px 0; }
.certs > .empty { grid-column: 1 / -1; }
.panel-nav .logout { margin: 0; }
.panel-nav .logout button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; font: 14px var(--font-body); color: var(--muted); background: none; border: 0; cursor: pointer; text-align: start; }
.panel-nav .logout button:hover { background: var(--surface-2); color: var(--ink); }
.panel-nav .logout .icon { width: 17px; height: 17px; }
.me .arch-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.panel-main { min-width: 0; }
.panel-main section[id] { scroll-margin-top: 90px; }
.thumb { background: linear-gradient(160deg, var(--t1, #5a4ea3), var(--t2, #3a307a)); overflow: hidden; text-align: center; line-height: 1.2; }
.progress-row .btn { padding: 6px 14px; font-size: 13px; }
.sub-h { font-size: 13px; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.event .btn { padding: 6px 14px; font-size: 13px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; pointer-events: none; cursor: not-allowed; }
.exam-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.exam-row:first-of-type { border-top: 0; padding-top: 0; }
.exam-row .info { flex: 1; min-width: 0; font-size: 14px; }
.exam-row .info small { display: block; color: var(--muted); font-size: 12px; }
.exam-row .btn { padding: 6px 14px; font-size: 13px; }
.cert a { color: var(--emerald); font-size: 13px; font-weight: 600; display: inline-block; margin-top: 6px; }
.note p { margin: 2px 0 0; color: var(--ink); white-space: pre-line; }

@media (max-width: 560px) {
  .progress-row { flex-wrap: wrap; }
  .progress-row .info { flex-basis: calc(100% - 80px); }
  .event, .exam-row { flex-wrap: wrap; }
  .welcome { padding: 20px 18px; }
}

/* ===== Lesson player ===== */
.learn-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; margin-top: 24px; }
.learn-main { min-width: 0; display: grid; gap: 16px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--emerald); }
.lesson-head h1 { font-family: var(--font-kufi); font-size: 22px; line-height: 1.6; }
.lesson-head small { color: var(--muted); font-size: 13px; }
.player { background: #120f22; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.player video, .player iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.media-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 14px; justify-items: start; }
.media-card audio { width: 100%; }
.media-card p { color: var(--muted); font-size: 14px; }
.pdf-frame { width: 100%; height: 70vh; min-height: 360px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.lesson-notes { white-space: pre-line; line-height: 2; font-size: 14.5px; }
.lesson-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.lesson-actions form { margin: 0; }
.done-mark { display: inline-flex; align-items: center; gap: 6px; color: #23865b; font-weight: 600; font-size: 14px; }
.learn-side { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; position: sticky; top: 100px; display: grid; gap: 14px; max-height: calc(100vh - 120px); overflow-y: auto; }
.learn-side h2 { font-family: var(--font-kufi); font-size: 17px; }
.learn-side .prog { margin-top: 4px; }
.learn-side .meta-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.chapter h3 { font-size: 13.5px; margin-bottom: 6px; color: var(--ink); }
.chapter ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chapter a { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.chapter a:hover { background: var(--surface-2); color: var(--ink); }
.chapter a[aria-current="page"] { background: rgba(var(--light-rgb), .08); color: var(--emerald); font-weight: 600; }
.chapter .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.chapter .tick .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.chapter .is-done .tick { background: #2f9e6f; border-color: #2f9e6f; color: #fff; }
.chapter .t { flex: 1; min-width: 0; }
.chapter .d { font-size: 11.5px; }
.side-exams { display: grid; gap: 6px; }
.side-exams a { color: var(--emerald); font-size: 13.5px; font-weight: 600; }

@media (max-width: 900px) {
  .learn-wrap { grid-template-columns: 1fr; }
  .learn-side { position: static; max-height: none; }
}

/* ===== Exams ===== */
.exam-wrap { max-width: 820px; margin: 24px auto 0; display: grid; gap: 16px; }
.exam-head { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.exam-head b { color: var(--ink); }
.q { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface); margin: 0; }
.q legend { font-weight: 700; font-size: 15px; line-height: 1.9; padding: 0 6px; }
.q .opts { display: grid; gap: 8px; margin-top: 8px; }
.q label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14.5px; background: var(--bg); }
.q label:hover { border-color: var(--emerald); }
.q input { accent-color: var(--emerald); width: 17px; height: 17px; margin-top: 4px; flex: none; }
.q label:has(input:checked) { border-color: var(--emerald); background: rgba(var(--light-rgb), .06); }
.result { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.result .score { font-family: var(--font-kufi); font-size: 34px; line-height: 1; color: var(--emerald); }
.result.fail .score { color: #a24a66; }

/* ===== Review form (course page) ===== */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; border: 0; padding: 0; margin: 0; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { font-size: 26px; color: var(--line); cursor: pointer; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #d9a441; }
.stars input:focus-visible + label { outline: 2px solid var(--light); outline-offset: 2px; border-radius: 4px; }
