/* Fonts: self-hosted woff2 from @fontsource 5.0.8 (SIL Open Font License, see fonts/LICENSE-*). */
@font-face {
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/readex-pro-arabic-400-normal.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/readex-pro-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/readex-pro-arabic-500-normal.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/readex-pro-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/readex-pro-arabic-700-normal.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/readex-pro-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Baloo Bhaijaan 2";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/baloo-bhaijaan-2-arabic-700-normal.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: "Baloo Bhaijaan 2";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/baloo-bhaijaan-2-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --navy: #17243A;
    --turquoise: #20B8A6;
    --turquoise-dark: #148C7E;
    --amber: #FFBF47;
    --bg: #F6F8FB;
    --surface: #FFFFFF;
    --text: #17243A;
    --muted: #5B6779;
    --border: #DCE2EA;
    --danger: #B42318;
    --danger-bg: #FEF3F2;
    --radius: 14px;
    --font-text: "Readex Pro", system-ui, sans-serif;
    --font-title: "Baloo Bhaijaan 2", "Readex Pro", system-ui, sans-serif;
    --font-code: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.7;
}

h1, h2, h3 {
    font-family: var(--font-title);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 .5em;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }

a { color: var(--turquoise-dark); }

code, pre, .ltr-code {
    font-family: var(--font-code);
    direction: ltr;
    text-align: left;
}

.wrap {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.main { flex: 1; padding-top: 24px; padding-bottom: 32px; }

/* Header and footer */
.site-header { background: var(--navy); color: #fff; }
.header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.brand {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: #fff;
    text-decoration: none;
}
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.nav a, .nav .link-button { color: #fff; text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav .link-button:hover { color: var(--amber); }
.inline-form { display: inline; margin: 0; }
.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.site-footer { border-top: 1px solid var(--border); padding: 16px 0; font-size: .9rem; color: var(--muted); }

/* Surfaces */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
}
.form-card { max-width: 480px; margin: 0 auto; }
.prose { max-width: 720px; margin: 0 auto; }
.prose ul { padding-inline-start: 1.2em; }
.muted { color: var(--muted); }
.hero { padding: 24px 0; }
.hero h1 { font-size: 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* Buttons */
.btn {
    display: inline-block;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--navy);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--turquoise); border-color: var(--turquoise); color: #fff; }
.btn-primary:hover { background: var(--turquoise-dark); }
.nav .btn-small { min-height: 0; padding: 4px 14px; background: var(--amber); border-color: var(--amber); color: var(--navy); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.field label { font-weight: 500; }
.field input:not([type="checkbox"]), .field select, .field textarea {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
.field input:focus, .field select:focus { outline: 2px solid var(--turquoise); outline-offset: 1px; }
.field input[dir="ltr"] { text-align: left; }
.field.check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.field.check input { width: 20px; height: 20px; accent-color: var(--turquoise); }
.field.check .field-error { flex-basis: 100%; }
.hint { font-size: .85rem; color: var(--muted); }
.field-error { font-size: .9rem; color: var(--danger); }
.alert {
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger);
}
form .btn[type="submit"] { width: 100%; }

/* Catalog, subscriptions and the student page */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.unit { margin-bottom: 24px; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lesson-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    min-height: 52px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
}
a.lesson-row:hover { border-color: var(--turquoise); }
.lesson-row.is-soon { color: var(--muted); }
.lesson-number {
    font-family: var(--font-title);
    color: var(--turquoise-dark);
    direction: ltr;
    unicode-bidi: isolate;
}
.lesson-title { flex: 1; min-width: 12ch; }
.badge {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: .8rem;
    color: var(--muted);
}
.badge-ok { background: #E6F7F5; border-color: var(--turquoise); color: var(--turquoise-dark); }
.lesson-section { margin-top: 24px; }
.video-slot {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius);
}
.slot-empty { text-align: center; }
.locked { border-color: var(--amber); background: #FFF8E8; }
.locked-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-top: 0; }
.lock-icon { color: var(--navy); flex: none; }
.terms { display: grid; gap: 12px; }
.term h3 { font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.term-en { font-family: var(--font-text); font-weight: 500; color: var(--turquoise-dark); }
.term p { margin: .4em 0; }
.page-ref { white-space: nowrap; }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 16px 0; }
.plan { text-align: center; }
.plan-price { font-size: 1.1rem; margin: 0; }
.plan-price strong { font-family: var(--font-title); font-size: 2.2rem; color: var(--turquoise-dark); }
.steps { padding-inline-start: 1.3em; }
.steps li { margin-bottom: 6px; }
.notice { padding: 10px 14px; border-radius: 10px; background: #E6F7F5; color: var(--turquoise-dark); }
.admin-block, .me-block { margin-bottom: 16px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: start; }
.status-on { color: var(--turquoise-dark); font-weight: 500; }
.status-off { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; }
.btn-small { min-height: 0; padding: 4px 14px; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
form .table .btn[type="submit"] { width: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 12px 8px; text-align: center; }
.stat-value { font-family: var(--font-title); font-size: 1.8rem; color: var(--navy); }
.stat-label { font-size: .85rem; color: var(--muted); }

/* Admin */
.admin-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.admin-stat h2 { font-size: 1rem; color: var(--muted); }
.admin-stat p { margin: 0; }
.stat-number { font-family: var(--font-title); font-size: 2rem; color: var(--navy); }
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; justify-content: space-between; gap: 8px; }
.search-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-bottom: 12px; }
.search-form .field { flex: 1 1 240px; margin-bottom: 0; }
.search-form .btn[type="submit"] { width: auto; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; white-space: nowrap; }
.data-table th { background: var(--bg); font-weight: 500; }
.ltr-cell { text-align: left; font-family: var(--font-code); }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--amber); color: var(--navy); font-size: .8rem; }
.tag-ok { background: var(--turquoise); color: #fff; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
