/* Eng. Mahmoud Ali — Neumorphism design system
   Soft extruded UI · LTR/RTL logical props */

:root {
    --ma-ink: #2A3340;
    --ma-ink-soft: #5A6573;
    --ma-ink-faint: #8A95A3;
    --ma-forest: #3D6B5E;
    --ma-forest-deep: #2F554A;
    --ma-forest-mid: #4A7D6E;
    --ma-copper: #C4783A;
    --ma-copper-soft: #D4985C;
    --ma-sand: #D9C4A8;
    --ma-sand-soft: #E8D9C4;
    --ma-paper: #E7F4ED;
    --ma-mist: #DCEFE5;
    --ma-mist-deep: #C9E4D6;
    --ma-surface: #F3FAF6;
    --ma-signal: #3D6B5E;
    --ma-white: #F4F7FA;
    --ma-danger: #B42318;
    --ma-success: #2F7A55;
    --ma-border: transparent;
    --ma-border-strong: transparent;
    --neo-light: rgba(255, 255, 255, 0.28);
    --neo-dark: rgba(16, 72, 52, 0.16);
    --neo-darker: rgba(10, 52, 36, 0.24);
    --ma-shadow: 0 10px 24px var(--neo-dark);
    --ma-shadow-sm: 0 5px 14px var(--neo-dark);
    --ma-shadow-hover: 0 14px 28px var(--neo-darker);
    --ma-inset: inset 0 2px 8px var(--neo-darker);
    --ma-inset-sm: inset 0 2px 6px var(--neo-dark);
    --ma-radius: 1.35rem;
    --ma-radius-sm: 1rem;
    --ma-radius-xs: 0.7rem;
    --ma-ring: 0 0 0 3px rgba(61, 107, 94, 0.22);
    --font-display: "Sora", "Manrope", system-ui, sans-serif;
    --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
    --font-arabic: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
}

html[lang="ar"],
html[dir="rtl"] {
    --font-display: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
    --font-body: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    min-height: 100%;
    background-color: #c5e6d6;
    background-image:
        radial-gradient(900px 520px at 92% -8%, rgba(86, 196, 140, 0.45), transparent 58%),
        radial-gradient(720px 480px at -10% 100%, rgba(18, 110, 74, 0.28), transparent 62%),
        radial-gradient(540px 380px at 48% 42%, rgba(184, 240, 208, 0.7), transparent 68%),
        linear-gradient(168deg, #dff3e8 0%, #b7ddcb 48%, #8fc9ad 100%);
    background-attachment: fixed;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body.ma-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ma-ink);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.ma-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'%3E%3Cg font-family='ui-monospace,monospace' font-weight='700'%3E%3Ctext x='16' y='36' fill='%23166543' fill-opacity='.42' font-size='18'%3E1%3C/text%3E%3Ctext x='78' y='28' fill='%230E4F36' fill-opacity='.32' font-size='13'%3E0%3C/text%3E%3Ctext x='132' y='48' fill='%233D9B6E' fill-opacity='.48' font-size='22'%3E0%3C/text%3E%3Ctext x='198' y='32' fill='%231B7A52' fill-opacity='.36' font-size='15'%3E1%3C/text%3E%3Ctext x='236' y='58' fill='%23094E3B' fill-opacity='.28' font-size='12'%3E0%3C/text%3E%3Ctext x='42' y='92' fill='%232E8B62' fill-opacity='.44' font-size='26'%3E0%3C/text%3E%3Ctext x='108' y='108' fill='%23166543' fill-opacity='.26' font-size='14'%3E1%3C/text%3E%3Ctext x='168' y='96' fill='%230E4F36' fill-opacity='.38' font-size='18'%3E1%3C/text%3E%3Ctext x='220' y='118' fill='%233D9B6E' fill-opacity='.32' font-size='16'%3E0%3C/text%3E%3Ctext x='18' y='156' fill='%23094E3B' fill-opacity='.3' font-size='15'%3E1%3C/text%3E%3Ctext x='74' y='172' fill='%231B7A52' fill-opacity='.46' font-size='20'%3E1%3C/text%3E%3Ctext x='146' y='164' fill='%230E4F36' fill-opacity='.28' font-size='13'%3E0%3C/text%3E%3Ctext x='196' y='186' fill='%232E8B62' fill-opacity='.4' font-size='24'%3E0%3C/text%3E%3Ctext x='248' y='158' fill='%23166543' fill-opacity='.32' font-size='14'%3E1%3C/text%3E%3Ctext x='34' y='228' fill='%233D9B6E' fill-opacity='.36' font-size='17'%3E0%3C/text%3E%3Ctext x='96' y='246' fill='%23094E3B' fill-opacity='.42' font-size='21'%3E1%3C/text%3E%3Ctext x='164' y='236' fill='%231B7A52' fill-opacity='.28' font-size='14'%3E0%3C/text%3E%3Ctext x='214' y='252' fill='%230E4F36' fill-opacity='.36' font-size='19'%3E1%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-size: 280px 280px;
    animation: bin-drift 32s linear infinite;
}

@keyframes bin-drift {
    from { background-position: 0 0; }
    to { background-position: 0 280px; }
}

.bin-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

a { color: var(--ma-signal); text-decoration: none; }
a:hover { color: var(--ma-copper); }

img { max-width: 100%; height: auto; display: block; }

/* ——— Brand lockup ——— */
.brand-lockup {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-decoration: none;
    line-height: 1.15;
}

.brand-lockup__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ma-ink);
}

html[lang="ar"] .brand-lockup__name { font-weight: 800; }

.brand-lockup__role {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ma-ink-soft);
}

.brand-lockup--ink .brand-lockup__name { color: var(--ma-ink); }
.brand-lockup--ink .brand-lockup__role { color: var(--ma-ink-soft); }

/* ——— Locale switcher ——— */
.ma-locale {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: var(--ma-surface);
    box-shadow: var(--ma-inset-sm);
    border: none;
}

.ma-locale__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ma-ink-soft);
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ma-locale__btn:hover,
.ma-locale__btn.is-active {
    background: var(--ma-surface);
    color: var(--ma-forest);
    box-shadow: var(--ma-shadow-sm);
    text-decoration: none;
}

/* ——— Buttons ——— */
.ma-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.35rem;
    border-radius: var(--ma-radius-sm);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    background: var(--ma-surface);
    color: var(--ma-ink);
    box-shadow: var(--ma-shadow-sm);
    transition: box-shadow 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ma-btn:focus-visible { outline: none; box-shadow: var(--ma-shadow-sm), var(--ma-ring); }
.ma-btn:hover { text-decoration: none; color: var(--ma-forest); }
.ma-btn:active {
    box-shadow: var(--ma-inset-sm);
    transform: translateY(1px);
}

.ma-btn--primary {
    color: #fff;
    background: linear-gradient(145deg, var(--ma-copper-soft), var(--ma-copper));
    box-shadow: 0 8px 18px var(--neo-dark);
}
.ma-btn--primary:hover { color: #fff; }
.ma-btn--primary:active {
    box-shadow: inset 4px 4px 10px rgba(0,0,0,0.18), inset -2px -2px 6px rgba(255,255,255,0.2);
}

.ma-btn--secondary,
.ma-btn--outline,
.ma-btn--ghost {
    background: var(--ma-surface);
    color: var(--ma-forest);
    box-shadow: var(--ma-shadow-sm);
}
.ma-btn--secondary:hover,
.ma-btn--outline:hover,
.ma-btn--ghost:hover { color: var(--ma-ink); }

.ma-btn--sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.ma-btn--block { width: 100%; }

/* ——— Forms ——— */
.ma-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.ma-field label { font-size: 0.88rem; font-weight: 700; color: var(--ma-ink); }

.ma-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.95rem;
    border: none;
    border-radius: var(--ma-radius-sm);
    background: var(--ma-surface);
    box-shadow: var(--ma-inset-sm);
    transition: box-shadow 0.2s ease;
}

.ma-input-wrap:focus-within {
    box-shadow: var(--ma-inset-sm), var(--ma-ring);
}

.ma-input-wrap i { color: var(--ma-ink-faint); }

.ma-input-wrap input,
.ma-input-wrap select,
.ma-input-wrap textarea {
    flex: 1;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.85rem 0;
    font: inherit;
    color: var(--ma-ink);
    outline: none;
}

.ma-input-wrap textarea { min-height: 110px; resize: vertical; }

select.ma-select,
input.ma-input,
textarea.ma-textarea {
    width: 100%;
    border: none;
    border-radius: var(--ma-radius-sm);
    background: var(--ma-surface);
    box-shadow: var(--ma-inset-sm);
    padding: 0.85rem 0.95rem;
    font: inherit;
    color: var(--ma-ink);
}
select.ma-select:focus,
input.ma-input:focus,
textarea.ma-textarea:focus {
    outline: none;
    box-shadow: var(--ma-inset-sm), var(--ma-ring);
}

/* ——— Cards / panels ——— */
.ma-card {
    background: rgba(243, 250, 246, 0.82);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: var(--ma-radius);
    box-shadow: var(--ma-shadow);
    padding: 1.35rem;
}

.ma-card--interactive {
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    cursor: pointer;
}
.ma-card--interactive:hover {
    box-shadow: var(--ma-shadow-hover);
}
.ma-card--interactive:active {
    box-shadow: var(--ma-inset);
}

.ma-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--ma-surface);
    color: var(--ma-forest);
    box-shadow: var(--ma-inset-sm);
}

.ma-badge--copper { color: #8A4E1C; }
.ma-badge--success { color: var(--ma-success); }
.ma-badge--danger { color: var(--ma-danger); }

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--ma-radius-sm);
    margin-bottom: 1rem;
    font-weight: 600;
    border: none;
    background: var(--ma-surface);
    box-shadow: var(--ma-inset-sm);
}
.alert-success { color: var(--ma-success); }
.alert-danger, .alert-error { color: var(--ma-danger); }
.alert-info, .alert-warning { color: #8A4E1C; }

/* ——— Page chrome ——— */
.ma-page-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--ma-ink);
}

html[lang="ar"] .ma-page-title { font-weight: 800; }

.ma-page-lead {
    margin: 0 0 1.5rem;
    color: var(--ma-ink-soft);
    max-width: 42rem;
    line-height: 1.65;
}

.ma-grid { display: grid; gap: 1.1rem; }
.ma-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ma-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .ma-grid--2,
    .ma-grid--3 { grid-template-columns: 1fr; }
}

.ma-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--ma-ink-soft);
    border: none;
    border-radius: var(--ma-radius);
    background: var(--ma-surface);
    box-shadow: var(--ma-inset);
}

.ma-table-wrap {
    overflow-x: auto;
    border-radius: var(--ma-radius-sm);
    background: var(--ma-surface);
    box-shadow: var(--ma-shadow);
}
.ma-table { width: 100%; border-collapse: collapse; background: transparent; }
.ma-table th,
.ma-table td {
    padding: 0.85rem 1rem;
    text-align: start;
    border-bottom: 1px solid rgba(154, 166, 180, 0.35);
    font-size: 0.92rem;
}
.ma-table th {
    background: transparent;
    font-weight: 700;
    color: var(--ma-forest);
}
.ma-table tr:last-child td { border-bottom: 0; }

@keyframes ma-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.ma-rise { animation: ma-rise 0.65s ease both; }
.ma-rise-delay-1 { animation-delay: 0.1s; }
.ma-rise-delay-2 { animation-delay: 0.2s; }
.ma-rise-delay-3 { animation-delay: 0.3s; }

.teacher-note {
    margin-top: 0.75rem;
    padding: 0.8rem 0.95rem;
    border-radius: var(--ma-radius-sm);
    background: #eef3f0;
}
.teacher-note__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ma-forest);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}
.teacher-note__body {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--ma-ink);
    unicode-bidi: plaintext;
    overflow-wrap: break-word;
}
.teacher-note__body .ltr-run {
    unicode-bidi: isolate;
}
