/* =====================================================================
   Bambini Musulmani — Interfaccia moderna v4
   Solo pagine pubbliche (l'area admin usa ancora style.css + admin.css)
   ===================================================================== */

:root {
    --primary: #10b981;
    --secondary: #3b82f6;
    --accent: #f59e0b;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 6px 24px -8px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg: 0 20px 48px -16px rgba(15, 23, 42, .25);
    --header-h: 68px;
    --sidebar-w: 290px;
    --font: 'Nunito', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-ar: 'Cairo', 'Tajawal', 'Nunito', sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body.site {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--secondary) 10%, transparent), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
html[dir="rtl"] body.site { font-family: var(--font-ar); }

img, video, iframe { max-width: 100%; height: auto; }
a { color: color-mix(in srgb, var(--secondary) 85%, #000); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--secondary) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 1000;
    background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, .8);
}
.header-inner {
    max-width: 1440px; margin: 0 auto;
    height: var(--header-h);
    padding: 0 20px;
    display: flex; align-items: center; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-logo {
    width: 44px; height: 44px; object-fit: contain;
    background: #fff; border-radius: 12px; padding: 3px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; font-weight: 900; letter-spacing: -.01em; }
.brand-text small { font-size: .74rem; color: var(--muted); font-weight: 600; }

.main-nav {
    display: flex; align-items: center; gap: 2px;
    margin-inline-start: 12px;
    overflow-x: auto; scrollbar-width: none;
    flex: 1; min-width: 0;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px; border-radius: 999px;
    color: var(--ink-2); font-weight: 700; font-size: .92rem; white-space: nowrap;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.main-nav a i { font-size: 1rem; opacity: .8; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.main-nav a.active {
    background: color-mix(in srgb, var(--primary) 14%, #fff);
    color: color-mix(in srgb, var(--primary) 70%, #000);
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-shrink: 0; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); font-size: 1.2rem; cursor: pointer;
    transition: background .2s, transform .2s;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.drawer-toggle, .drawer-close { display: none; }

/* Lingua */
.lang-dropdown { position: relative; }
.lang-btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 12px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface);
    font: inherit; font-weight: 700; font-size: .9rem; color: var(--ink-2); cursor: pointer;
}
.lang-btn img, .lang-menu img { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lang-btn .bi-chevron-down { font-size: .75rem; transition: transform .2s; }
.lang-btn[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.lang-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    min-width: 200px; max-height: 70vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s; z-index: 60;
}
.lang-menu.show { opacity: 1; visibility: visible; transform: none; }
.lang-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .92rem;
}
.lang-menu a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu a.active { background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--ink); }
.lang-menu a .bi-check2 { margin-inline-start: auto; color: var(--primary); }

/* ---------- News ticker ---------- */
.news-ticker {
    display: flex; align-items: center; overflow: hidden;
    background: linear-gradient(90deg, var(--accent), #fb923c);
    color: #fff; font-weight: 700; font-size: .92rem;
}
.news-label { padding: 7px 14px; background: rgba(0,0,0,.12); flex-shrink: 0; }
.news-track { overflow: hidden; flex: 1; }
.news-content { display: inline-block; white-space: nowrap; padding-inline-start: 100%; animation: bm-ticker 30s linear infinite; }
.news-ticker[data-direction="right"] .news-content { animation-name: bm-ticker-r; }
.news-content a { color: #fff; }
.news-ticker:hover .news-content { animation-play-state: paused; }
@keyframes bm-ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes bm-ticker-r { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* ---------- Layout ---------- */
.site-shell {
    width: 100%; max-width: 1440px; margin: 0 auto;
    padding: 24px 20px 48px;
    display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 24px; align-items: start; flex: 1;
}
.site-shell.box-mode { max-width: 1200px; }
.content { min-width: 0; }
#page-content { min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky; top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto; scrollbar-width: thin;
    display: flex; flex-direction: column; gap: 16px;
    padding-bottom: 4px;
}
.sidebar-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.sidebar-title {
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); padding: 4px 6px 10px;
}
html[dir="rtl"] .sidebar-title { letter-spacing: 0; font-size: .9rem; }

.cat-nav, .quick-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cat-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 8px; border-radius: 12px;
    color: var(--ink-2); font-weight: 700; font-size: .95rem;
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.cat-nav a:hover { background: color-mix(in srgb, var(--c) 10%, #fff); text-decoration: none; transform: translateX(2px); }
html[dir="rtl"] .cat-nav a:hover { transform: translateX(-2px); }
.cat-nav a.active { background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--ink); }
.cat-ico {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--c); font-size: 1.05rem;
}
.cat-nav a.active .cat-ico { background: var(--c); color: #fff; }
.cat-label { line-height: 1.25; }

.quick-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: .93rem;
}
.quick-nav a:hover { background: var(--surface-2); text-decoration: none; }
.quick-nav i { color: var(--secondary); }

.sidebar-sponsors {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-radius: var(--radius);
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px dashed #fbbf24; color: #92400e; font-weight: 700; font-size: .9rem;
}
.sidebar-sponsors:hover { text-decoration: none; filter: brightness(.98); }

.drawer-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px); z-index: 70;
}

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
    padding: 44px 44px; margin-bottom: 24px;
    border-radius: 28px; color: #fff;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1.5'%3E%3Cpath d='M40 6l10 24 24 10-24 10-10 24-10-24L6 40l24-10z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--primary) 0%, #0ea5a4 45%, var(--secondary) 100%);
    box-shadow: var(--shadow);
}
.hero::after {
    content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%;
    inset-inline-end: -120px; top: -160px; background: rgba(255,255,255,.12);
}
.hero-text { position: relative; z-index: 1; max-width: 640px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.18);
    font-weight: 800; font-size: .82rem; margin-bottom: 14px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.15; font-weight: 900; letter-spacing: -.02em; }
.hero p { margin: 0 0 22px; font-size: 1.08rem; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { position: relative; z-index: 1; }
.hero-art img {
    width: 170px; height: 170px; object-fit: contain;
    background: #fff; border-radius: 32px; padding: 10px;
    box-shadow: 0 20px 40px -12px rgba(0,0,0,.35);
    transform: rotate(-4deg); animation: bm-float 6s ease-in-out infinite;
}
@keyframes bm-float { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-8px); } }
.hero-compact { padding: 28px 32px; }
.hero-compact .hero-art { display: none; }

/* ---------- Slideshow ---------- */
.slideshow {
    position: relative; height: clamp(220px, 34vw, 400px);
    border-radius: 28px; overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow);
    background: var(--ink);
}
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .8s ease; }
.slide.active { opacity: 1; }
.slide-overlay {
    position: absolute; inset: auto 0 0 0; padding: 28px 32px;
    background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
    color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.slide-overlay h2 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.9rem); font-weight: 900; }
.slide-prev, .slide-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.85); color: var(--ink); font-size: 1.2rem; display: grid; place-items: center;
}
.slide-prev { inset-inline-start: 14px; }
.slide-next { inset-inline-end: 14px; }
html[dir="rtl"] .slide-prev i, html[dir="rtl"] .slide-next i { display: inline-block; transform: scaleX(-1); }
.slide-dots { position: absolute; top: 16px; inset-inline-end: 18px; display: flex; gap: 6px; }
.slide-dot { width: 10px; height: 10px; border-radius: 999px; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; transition: width .3s; }
.slide-dot.active { width: 26px; background: #fff; }

/* ---------- Quick access ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.quick-card {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    color: var(--ink); font-weight: 800;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.quick-card i {
    width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 1.3rem;
    background: color-mix(in srgb, var(--c) 15%, #fff); color: var(--c);
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }

/* ---------- Sezioni ---------- */
section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.45rem; font-weight: 900; letter-spacing: -.01em; }
.link-more { font-weight: 800; font-size: .92rem; }

/* Categorie */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cat-card {
    position: relative; display: flex; flex-direction: column; gap: 14px;
    min-height: 150px; padding: 18px;
    border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    color: var(--ink); overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.cat-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); opacity: .9;
}
.cat-card-ico {
    width: 52px; height: 52px; border-radius: 16px;
    display: grid; place-items: center; font-size: 1.5rem;
    background: color-mix(in srgb, var(--c) 15%, #fff); color: var(--c);
    transition: transform .3s var(--ease), background .3s, color .3s;
}
.cat-card-title { font-weight: 800; font-size: 1.02rem; line-height: 1.3; padding-inline-end: 22px; }
.cat-card-arrow {
    position: absolute; inset-inline-end: 16px; bottom: 16px;
    color: var(--muted); transition: transform .25s var(--ease), color .25s;
}
.cat-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--c) 40%, var(--line)); text-decoration: none;
}
.cat-card:hover .cat-card-ico { background: var(--c); color: #fff; transform: scale(1.06) rotate(-4deg); }
.cat-card:hover .cat-card-arrow { color: var(--c); transform: translateX(4px); }
html[dir="rtl"] .cat-card:hover .cat-card-arrow { transform: translateX(-4px) scaleX(-1); }

/* Corsi */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.course-card {
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.course-media {
    aspect-ratio: 16 / 9; display: grid; place-items: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, #fff), color-mix(in srgb, var(--secondary) 18%, #fff));
    color: var(--secondary); font-size: 2.4rem;
}
.course-media img { width: 100%; height: 100%; object-fit: cover; }
.course-body { padding: 14px 16px 18px; }
.course-body h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 800; }
.course-body p { margin: 0; color: var(--muted); font-size: .9rem; }

.empty-state {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    padding: 36px 20px; border-radius: var(--radius);
    background: var(--surface); border: 2px dashed var(--line); color: var(--muted);
}
.empty-state i { font-size: 2.2rem; color: var(--secondary); opacity: .7; }
.empty-state strong { color: var(--ink); font-size: 1.05rem; }
.empty-state p { margin: 0; }

/* ---------- Contenuto pagine interne ---------- */
#page-content > h1:first-child, #page-content h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 900; letter-spacing: -.02em; margin: 4px 0 12px; }
#page-content h2 { font-weight: 900; }

/* ---------- Componenti generici (usati da tutte le pagine) ---------- */
.card {
    display: block; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 16px; color: inherit;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.card img { border-radius: 12px; }
.card-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-weight: 800; font-size: .95rem; line-height: 1.2;
    cursor: pointer; text-decoration: none !important; white-space: nowrap;
    transition: transform .15s var(--ease), box-shadow .2s, background .2s, filter .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 13px; font-size: .88rem; border-radius: 11px; height: 40px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary, a.btn-primary, a.btn-primary:visited {
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--secondary)));
    color: #fff; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-secondary, a.btn-secondary, a.btn-secondary:visited { background: var(--secondary); color: #fff; }
.btn-secondary:hover { filter: brightness(1.06); }
.btn-danger, a.btn-danger, a.btn-danger:visited { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost, a.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-light, a.btn-light { background: #fff; color: var(--ink); box-shadow: 0 8px 20px -10px rgba(0,0,0,.4); }
.btn-light:hover { transform: translateY(-1px); }
.btn-outline-light, a.btn-outline-light { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.18); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.form-group input, .form-group select, .form-group textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="search"], select, textarea {
    width: 100%; padding: 12px 14px; font: inherit; font-size: .98rem; color: var(--ink);
    background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
input:focus, select:focus, textarea:focus {
    outline: none; background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-start: 42px; }
.pw-toggle {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted);
    border-radius: 10px; cursor: pointer; font-size: 1.05rem;
}
.pw-toggle:hover { background: var(--line); }

.alert { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; font-size: .93rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Auth */
.auth-wrap { display: grid; place-items: center; padding: 24px 0 40px; }
.auth-card {
    width: 100%; max-width: 440px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 24px; box-shadow: var(--shadow-lg); padding: 34px 32px 26px;
}
.auth-card-wide { max-width: 560px; }
.auth-icon {
    width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px;
    display: grid; place-items: center; font-size: 1.8rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--primary) 70%, transparent);
}
.auth-title { text-align: center; margin: 0 0 22px !important; font-size: 1.7rem !important; }
.auth-switch { text-align: center; margin: 18px 0 0; font-weight: 700; }

/* Vecchio mosaico (se usato da altre pagine) */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.mosaic-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); box-shadow: var(--shadow-sm); }
.mosaic-icon { height: 100px; display: grid; place-items: center; color: #fff; font-size: 2rem; }
.mosaic-title { padding: 12px; font-weight: 800; text-align: center; }

table { width: 100%; border-collapse: collapse; }

.flip-rtl { display: inline-block; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-color, #0f172a); color: #cbd5e1; margin-top: auto; }
.footer-inner {
    max-width: 1440px; margin: 0 auto; padding: 36px 20px 20px;
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px;
}
.footer-brand strong { color: #fff; font-size: 1.15rem; font-weight: 900; }
.footer-brand p { margin: 6px 0 0; max-width: 420px; font-size: .93rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-content: start; }
.footer-links a, .footer-contact a { color: #e2e8f0; font-weight: 700; font-size: .93rem; }
.footer-contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .9rem; }
.footer-bottom {
    max-width: 1440px; margin: 0 auto; padding: 16px 20px 22px;
    border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: #94a3b8; text-align: center;
}
.footer-bottom strong { color: #e2e8f0; }

/* ---------- Corano a schermo intero ---------- */
body.quran-fullscreen .site-shell { display: block; max-width: none; padding: 0; }
body.quran-fullscreen .site-header { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
    .main-nav a span { display: none; }
    .main-nav a { padding: 9px 11px; }
    .main-nav a i { font-size: 1.1rem; opacity: 1; }
}

@media (max-width: 960px) {
    :root { --header-h: 62px; }
    .drawer-toggle, .drawer-close { display: inline-grid; }
    .main-nav { display: none; }
    .site-shell { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 40px; }

    .sidebar {
        position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 80;
        width: min(86vw, 330px); max-height: none;
        padding: 14px; background: var(--bg);
        box-shadow: var(--shadow-lg);
        transform: translateX(-105%); transition: transform .3s var(--ease);
    }
    html[dir="rtl"] .sidebar { transform: translateX(105%); }
    body.drawer-open .sidebar { transform: none; }
    body.drawer-open { overflow: hidden; }

    .hero { grid-template-columns: 1fr; padding: 30px 24px; border-radius: 22px; }
    .hero-art { display: none; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .header-inner { padding: 0 12px; gap: 8px; }
    .brand-text small, .hide-sm, .lang-btn .lang-name { display: none; }
    .hide-xs { display: none; }
    .brand-text strong { font-size: .98rem; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cat-card { min-height: 130px; padding: 14px; }
    .cat-card-title { font-size: .93rem; }
    .quick-card { padding: 12px; font-size: .92rem; }
    .quick-card i { width: 38px; height: 38px; font-size: 1.1rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .auth-card { padding: 26px 20px 20px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Pagine categoria / corso ---------- */
.page-hero {
    display: flex; align-items: center; gap: 20px; padding: 26px 28px; margin-bottom: 24px;
    border-radius: 24px; color: #fff; box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #0f172a));
}
.page-hero-ico { width: 68px; height: 68px; border-radius: 20px; flex-shrink: 0; display: grid; place-items: center; font-size: 2rem; background: rgba(255,255,255,.2); }
.page-hero h1 { margin: 0 0 4px !important; color: #fff; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 900; }
.page-hero p { margin: 0; opacity: .95; }
.course-media { position: relative; color: var(--c, var(--secondary)); background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--primary)) 18%, #fff), color-mix(in srgb, var(--c, var(--secondary)) 30%, #fff)); }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .84rem; font-weight: 700; color: var(--muted); }
.course-meta.light { color: rgba(255,255,255,.9); }
.course-cat { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 75%, #000); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { color: var(--ink); }
.crumbs i { font-size: .7rem; }

.lessons { display: grid; gap: 12px; }
.lesson { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.lesson[open] { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.lesson summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.lesson summary::-webkit-details-marker { display: none; }
.lesson-num { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--c); }
.lesson-title { flex: 1; font-weight: 800; font-size: 1.05rem; }
.lesson-title small { display: table; font-weight: 700; color: var(--muted); font-size: .92rem; font-family: var(--font-ar); }
.lesson-chev { color: var(--muted); transition: transform .2s; }
.lesson[open] .lesson-chev { transform: rotate(180deg); }
.lesson-body { padding: 0 18px 20px; padding-inline-start: 70px; }
.lesson-text { font-size: 1.04rem; line-height: 1.75; color: var(--ink-2); }
.lesson-text-ar { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--c) 7%, #fff); border-inline-end: 4px solid var(--c); font-family: var(--font-ar); font-size: 1.12rem; line-height: 1.9; color: var(--ink); }
.lesson-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.lesson-video { position: relative; aspect-ratio: 16/9; margin-top: 14px; border-radius: 14px; overflow: hidden; background: #000; }
.lesson-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 560px) { .lesson-body { padding-inline-start: 18px; } .page-hero { padding: 20px; gap: 14px; } .page-hero-ico { width: 54px; height: 54px; font-size: 1.6rem; } }


/* ---------- Voce (lettura ad alta voce) ---------- */
.say-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--secondary) 35%, #fff); background: #eff6ff; color: color-mix(in srgb, var(--secondary) 80%, #000);
    font: inherit; font-size: .88rem; font-weight: 800; cursor: pointer; transition: background .2s, color .2s, transform .1s; vertical-align: middle;
}
.say-btn:hover { background: var(--secondary); color: #fff; }
.say-btn:active { transform: scale(.95); }
.say-btn.say-active { background: var(--secondary); color: #fff; animation: say-pulse 1s infinite; }
.say-btn-round { width: 38px; height: 38px; padding: 0; justify-content: center; flex-shrink: 0; }
.say-btn-block { margin-bottom: 10px; }
[dir="rtl"] .say-btn-block, .lesson-text-ar .say-btn-block { font-family: var(--font-ar); }
@keyframes say-pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--secondary) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.say-line { margin: 2px 0; }
.say-item { cursor: pointer; border-radius: 8px; padding: 1px 4px; margin: 0 -4px; border-bottom: 2px dotted color-mix(in srgb, var(--secondary) 40%, transparent); transition: background .15s; }
.say-item:hover { background: color-mix(in srgb, var(--secondary) 12%, #fff); }
.say-item.say-active { background: #fef08a; border-bottom-color: #eab308; }
.say-sep { color: var(--muted); }
.say-hint { display: flex; align-items: center; gap: 8px; margin: -8px 0 14px; color: var(--muted); font-weight: 700; font-size: .92rem; }
.say-hint i { color: var(--secondary); }
.lesson summary .say-btn { margin-inline-start: 6px; }
.say-turtle {
    position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 150; width: 52px; height: 52px; border-radius: 50%;
    border: 2px solid var(--line); background: #fff; font-size: 1.6rem; cursor: pointer; box-shadow: var(--shadow); opacity: .7; transition: opacity .2s, transform .2s;
}
.say-turtle:hover { opacity: 1; transform: scale(1.06); }
.say-turtle.on { opacity: 1; border-color: #10b981; background: #ecfdf5; }
.say-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); z-index: 300; max-width: min(92vw, 520px);
    padding: 14px 18px; border-radius: 16px; background: #0f172a; color: #fff; font-size: .92rem; line-height: 1.5;
    box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .3s, transform .3s;
}
.say-toast.show { opacity: 1; transform: translate(-50%, 0); }
.say-gender { bottom: 80px; opacity: .85; }
.footer-bottom a { color: #e2e8f0; text-decoration: none; }
.footer-bottom a:hover { color: #6ee7b7; text-decoration: underline; }
