:root {
    --blue: #007bff;
    --blue-dark: #0056b3;
    --blue-light: #66b0ff;
    --green: #28a745;
    --green-dark: #1e7e34;
}

.input-field {

    @apply w-full px-4 py-3 rounded-xl border border-slate-300 dark:border-slate-600

           bg-white dark:bg-surface text-slate-900 dark:text-white

           focus:ring-2 focus:ring-brand focus:border-transparent outline-none transition;

}



/* Fallback if Tailwind @apply not processed via CDN */

input.input-field,

textarea.input-field,

select.input-field {

    width: 100%;

    padding: 0.75rem 1rem;

    border-radius: 0.75rem;

    border: 1px solid #cbd5e1;

    background: white;

    outline: none;

    transition: box-shadow 0.2s, border-color 0.2s;

}



input.input-field:focus,

textarea.input-field:focus,

select.input-field:focus {

    box-shadow: 0 0 0 2px var(--blue);

    border-color: transparent;

}



.dark input.input-field,

.dark textarea.input-field,

.dark select.input-field {

    background: #1E293B;

    border-color: #475569;

    color: #f1f5f9;

}



/* Scrollbar */

::-webkit-scrollbar { width: 6px; height: 6px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

.dark ::-webkit-scrollbar-thumb { background: #475569; }



/* Atmosphere */

.hero-atmosphere {

    background:

        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(0, 123, 255, 0.18), transparent 55%),

        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(0, 123, 255, 0.08), transparent 50%),

        linear-gradient(165deg, #E7F1FF 0%, #F8FAFC 45%, #F1F5F9 100%);

    position: relative;

    overflow: hidden;

}



.dark .hero-atmosphere {

    background:

        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(0, 123, 255, 0.12), transparent 55%),

        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(0, 123, 255, 0.06), transparent 50%),

        linear-gradient(165deg, #1E293B 0%, #0F172A 100%);

}



.hero-atmosphere::before {

    content: '';

    position: absolute;

    inset: 0;

    background-image:

        linear-gradient(rgba(0, 123, 255, 0.06) 1px, transparent 1px),

        linear-gradient(90deg, rgba(0, 123, 255, 0.06) 1px, transparent 1px);

    background-size: 48px 48px;

    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 85%);

    pointer-events: none;

}



.courses-page-hero {

    background:

        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(0, 123, 255, 0.14), transparent 50%),

        linear-gradient(180deg, #E7F1FF 0%, #F8FAFC 100%);

}



.dark .courses-page-hero {

    background:

        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(0, 123, 255, 0.1), transparent 50%),

        linear-gradient(180deg, #1E293B 0%, #0F172A 100%);

}



/* Hero portrait */

.hero-portrait {

    position: relative;

    width: min(100%, 20rem);

}



@media (min-width: 640px) {

    .hero-portrait {

        width: min(100%, 24rem);

    }

}



@media (min-width: 1024px) {

    .hero-portrait {

        width: min(100%, 26rem);

    }

}



.hero-portrait__glow {

    position: absolute;

    inset: 8% -6% -4% 8%;

    background: radial-gradient(circle at 40% 40%, rgba(0, 123, 255, 0.45), rgba(0, 123, 255, 0.08) 55%, transparent 70%);

    filter: blur(28px);

    z-index: 0;

    animation: hero-glow-pulse 5s ease-in-out infinite;

}



.hero-portrait__frame {

    position: relative;

    z-index: 2;

    border-radius: 1.75rem;

    overflow: hidden;

    aspect-ratio: 4 / 5;

    background: #e2e8f0;

    box-shadow:

        0 25px 50px -20px rgba(15, 23, 42, 0.35),

        0 0 0 1px rgba(0, 123, 255, 0.2);

    transform: rotate(-2.5deg);

    transition: transform 0.45s ease, box-shadow 0.45s ease;

}



.hero-portrait:hover .hero-portrait__frame {

    transform: rotate(0deg) translateY(-4px);

    box-shadow:

        0 30px 55px -18px rgba(0, 123, 255, 0.35),

        0 0 0 1px rgba(0, 123, 255, 0.35);

}



.hero-portrait__img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    object-position: center top;

}



.hero-portrait__accent {

    position: absolute;

    z-index: 1;

    inset: 1.25rem -0.85rem -0.85rem 1.25rem;

    border-radius: 1.75rem;

    border: 2px solid rgba(0, 123, 255, 0.55);

    transform: rotate(3deg);

    pointer-events: none;

}



/* About story */

.about-hero-card {
    position: relative;
    width: min(100%, 24rem);
    border-radius: 2rem;
}

.about-hero-card::before {
    content: '';
    position: absolute;
    inset: 1rem -1rem -1rem 1rem;
    border: 2px solid rgba(0, 123, 255, 0.45);
    border-radius: 2rem;
    transform: rotate(3deg);
}

.about-hero-card__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
    border-radius: 2rem;
    box-shadow: 0 30px 60px -24px rgba(15, 23, 42, 0.45);
}

.about-hero-card__caption {
    position: relative;
    z-index: 2;
    width: calc(100% - 2rem);
    margin: -3rem auto 0;
    padding: 1rem 1.15rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 123, 255, 0.18);
    box-shadow: 0 20px 40px -25px rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(14px);
}

.dark .about-hero-card__caption {
    background: rgba(51, 65, 85, 0.88);
    border-color: rgba(102, 176, 255, 0.22);
}

.about-hero-card__caption span,
.about-hero-card__caption strong {
    display: block;
}

.about-hero-card__caption span {
    color: #64748b;
    font-size: 0.85rem;
}

.dark .about-hero-card__caption span {
    color: #cbd5e1;
}

.about-hero-card__caption strong {
    margin-top: 0.25rem;
    color: #007bff;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: 1.05rem;
}

.story-timeline {
    position: relative;
    display: grid;
    gap: 2rem;
}

.story-timeline::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    right: 1.4rem;
    width: 2px;
    background: linear-gradient(to bottom, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.45), rgba(0, 123, 255, 0.1));
}

.story-stage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    margin-right: 2.75rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 20px 45px -30px rgba(15, 23, 42, 0.3);
}

.story-stage::before {
    content: '';
    position: absolute;
    top: 2rem;
    right: -2.35rem;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: #007bff;
    box-shadow: 0 0 0 0.45rem rgba(0, 123, 255, 0.14);
}

.dark .story-stage {
    background: rgba(51, 65, 85, 0.62);
    border-color: rgba(71, 85, 105, 0.9);
    box-shadow: 0 20px 45px -30px rgba(0, 0, 0, 0.55);
}

.story-stage__media {
    overflow: hidden;
    border-radius: 1.25rem;
    background: #e2e8f0;
}

.story-stage__image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 11;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.story-stage:hover .story-stage__image {
    transform: scale(1.04);
}

.story-stage__content {
    align-self: center;
}

.story-stage__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-weight: 800;
}

.story-stage__lesson {
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(0, 123, 255, 0.08);
    color: #0056b3;
    font-weight: 700;
    line-height: 1.7;
}

.dark .story-stage__lesson {
    color: #66b0ff;
    background: rgba(0, 123, 255, 0.12);
}

.story-value-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.dark .story-value-card {
    background: #334155;
    border-color: #475569;
}

.story-value-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 123, 255, 0.45);
    box-shadow: 0 18px 35px -24px rgba(0, 123, 255, 0.5);
}

@media (min-width: 1024px) {
    .about-hero-card {
        width: min(100%, 26rem);
    }

    .story-timeline::before {
        right: 50%;
        transform: translateX(50%);
    }

    .story-stage {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: 2rem;
        margin-right: 0;
        padding: 1.5rem;
    }

    .story-stage::before {
        right: 50%;
        top: 50%;
        transform: translate(50%, -50%);
    }

    .story-stage--reverse .story-stage__media {
        order: 2;
    }

    .story-stage--reverse .story-stage__content {
        order: 1;
    }
}



@keyframes hero-glow-pulse {

    0%, 100% { opacity: 0.75; transform: scale(1); }

    50% { opacity: 1; transform: scale(1.04); }

}



@media (max-width: 1023px) {

    .hero-portrait {

        margin-inline: auto;

    }



    .hero-portrait__frame {

        transform: rotate(-1.5deg);

    }

}



/* Motion */

@keyframes fade-up {

    from {

        opacity: 0;

        transform: translateY(1.25rem);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}



.animate-fade-up {

    animation: fade-up 0.7s ease-out both;

}



.animate-fade-up-delay {

    animation: fade-up 0.7s ease-out 0.15s both;

}



.animate-fade-up-delay-2 {

    animation: fade-up 0.7s ease-out 0.3s both;

}



.domain-link {

    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;

}



.domain-link:hover {

    transform: translateY(-3px);

}



.course-card {

    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;

}



.course-card:hover {

    transform: translateY(-4px);

    box-shadow: 0 20px 40px -20px rgba(0, 123, 255, 0.35);

}



.course-card img {

    transition: transform 0.45s ease;

}



.course-card:hover img {

    transform: scale(1.05);

}



@media (prefers-reduced-motion: reduce) {

    .animate-fade-up,

    .animate-fade-up-delay,

    .animate-fade-up-delay-2 {

        animation: none;

    }



    .domain-link:hover,

    .course-card:hover,

    .course-card:hover img {

        transform: none;

    }



    .hero-portrait__glow {

        animation: none;

    }



    .hero-portrait__frame,

    .hero-portrait:hover .hero-portrait__frame {

        transform: none;

        transition: none;

    }



    .mobile-drawer,

    .mobile-nav-overlay {

        transition: none;

    }

}



/* Mobile off-canvas drawer (RTL: slides from the right) */

.mobile-nav-overlay {

    position: fixed;

    inset: 0;

    z-index: 40;

    background: rgba(15, 23, 42, 0.5);

    opacity: 0;

    pointer-events: none;

    transition: opacity 0.2s ease;

}



.mobile-nav-overlay.is-open {

    opacity: 1;

    pointer-events: auto;

}



.mobile-drawer {

    position: fixed;

    top: 0;

    right: 0;

    bottom: 0;

    z-index: 50;

    transform: translateX(100%);

    transition: transform 0.25s ease;

    pointer-events: none;

    visibility: hidden;

}



.mobile-drawer.is-open {

    transform: translateX(0);

    pointer-events: auto;

    visibility: visible;

}



body.nav-locked {

    overflow: hidden;

}



@media (min-width: 1024px) {

    .mobile-nav-overlay {

        display: none !important;

    }



    .mobile-drawer {

        position: static;

        transform: none !important;

        max-width: none;

        pointer-events: auto;

        visibility: visible;

    }



    body.nav-locked {

        overflow: auto;

    }

}



.public-nav-panel {

    display: none;

}



.public-nav-panel.is-open {

    display: block;

}



/* Landing pages */
.landing-hero {
    background:
        radial-gradient(ellipse 80% 60% at 80% 10%, rgba(0, 123, 255, 0.18), transparent 55%),
        linear-gradient(165deg, #E7F1FF 0%, #F8FAFC 45%, #F1F5F9 100%);
}

.dark .landing-hero {
    background:
        radial-gradient(ellipse 80% 60% at 80% 10%, rgba(0, 123, 255, 0.12), transparent 55%),
        linear-gradient(165deg, #1E293B 0%, #0F172A 100%);
}

.landing-hero-media {
    position: relative;
}

.landing-hero-media__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 11;
    object-fit: cover;
    border-radius: 1.75rem;
    box-shadow: 0 30px 60px -28px rgba(15, 23, 42, 0.45);
}

.landing-benefit-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
}

.dark .landing-benefit-card {
    background: #334155;
    border-color: #475569;
}

.landing-curriculum {
    background: rgba(255, 255, 255, 0.55);
}

.dark .landing-curriculum {
    background: rgba(51, 65, 85, 0.25);
}

.landing-curriculum-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem 1.25rem;
    border-radius: 1.15rem;
    background: white;
    border: 1px solid #e2e8f0;
}

.dark .landing-curriculum-item {
    background: #334155;
    border-color: #475569;
}

.landing-curriculum-item__num {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    font-weight: 800;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.landing-form-section {
    background:
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(0, 123, 255, 0.08), transparent 50%),
        #F8FAFC;
}

.dark .landing-form-section {
    background:
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(0, 123, 255, 0.08), transparent 50%),
        #0F172A;
}

.landing-faq summary::-webkit-details-marker {
    display: none;
}

/* Lesson resources (rich text from admin editor) */
.lesson-resources {
    direction: rtl;
    text-align: right;
    line-height: 1.75;
    color: #334155;
    word-break: break-word;
}

.dark .lesson-resources {
    color: #cbd5e1;
}

.lesson-resources p {
    margin-bottom: 0.75rem;
}

.lesson-resources p:last-child {
    margin-bottom: 0;
}

.lesson-resources h2,
.lesson-resources h3 {
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.dark .lesson-resources h2,
.dark .lesson-resources h3 {
    color: #f1f5f9;
}

.lesson-resources h2 {
    font-size: 1.125rem;
}

.lesson-resources h3 {
    font-size: 1rem;
}

.lesson-resources ul,
.lesson-resources ol {
    margin: 0.5rem 0 0.75rem;
    padding-right: 1.5rem;
    padding-left: 0;
}

.lesson-resources li {
    margin-bottom: 0.35rem;
}

.lesson-resources a {
    color: #007bff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lesson-resources a:hover {
    color: #0056b3;
}

.lesson-resources blockquote {
    border-right: 3px solid #007bff;
    padding-right: 1rem;
    margin: 0.75rem 0;
    color: #64748b;
    font-style: italic;
}

.lesson-resources code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, monospace;
}

.dark .lesson-resources code {
    background: #1e293b;
}

.lesson-resources pre {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    font-family: ui-monospace, monospace;
}

.dark .lesson-resources pre {
    background: #1e293b;
}

.lesson-resources pre code {
    background: none;
    padding: 0;
}
