/* Import Font */
@import url("https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&display=swap");

/* Global Reset and Defaults */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: "Almarai", sans-serif;
}

body {
    margin: 0;
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.10) 0%, transparent 45%),
                #0c0f1d;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 100vh;
}

/* ============ Brand / Hero Side (Glass Canvas) ============ */
.brand-side {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 320px;
    background: linear-gradient(
        135deg, 
        #090c21 0%, 
        #180e3b 18%, 
        #341b77 36%, 
        #6d28d9 52%, 
        #2563eb 72%, 
        #0284c7 88%, 
        #1e1b4b 100%
    );
    background-size: 300% 300%;
    animation: gradient-move 14s ease-in-out infinite;
    color: #fff;
    padding: 60px 40px;
}

@keyframes gradient-move {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Delicate Tech Dot Matrix Grid Overlay */
.brand-side::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.2px, transparent 1.2px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.9) 30%, rgba(0, 0, 0, 0) 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.9) 30%, rgba(0, 0, 0, 0) 85%);
    pointer-events: none;
    z-index: 1;
}

/* Atmospheric Aurora Light Sweep */
.brand-side::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 220deg at 50% 50%,
        transparent 0deg,
        rgba(124, 58, 237, 0.12) 40deg,
        rgba(14, 165, 233, 0.1) 80deg,
        transparent 140deg,
        rgba(168, 85, 247, 0.08) 220deg,
        transparent 360deg
    );
    animation: aurora-spin 36s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes aurora-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.brand-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(75px);
    opacity: 0.85;
    mix-blend-mode: screen;
}

.orb-1 {
    width: 480px;
    height: 480px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.6) 0%, rgba(124, 58, 237, 0) 70%);
    animation: orb-float-1 14s ease-in-out infinite;
}

.orb-2 {
    width: 420px;
    height: 420px;
    bottom: -100px;
    right: -60px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.5) 0%, rgba(14, 165, 233, 0) 70%);
    animation: orb-float-2 16s ease-in-out infinite;
}

.orb-3 {
    width: 320px;
    height: 320px;
    top: 35%;
    left: 55%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(236, 72, 153, 0) 70%);
    animation: orb-float-3 18s ease-in-out infinite;
}

.orb-4 {
    width: 380px;
    height: 380px;
    bottom: 12%;
    left: -60px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.48) 0%, rgba(79, 70, 229, 0) 70%);
    animation: orb-float-1 20s ease-in-out infinite reverse;
}

@keyframes orb-float-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -35px) scale(1.08);
    }
}

@keyframes orb-float-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-35px, 25px) scale(1.06);
    }
}

@keyframes orb-float-3 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(25px, 25px) scale(0.95);
    }
}

.edu-icons {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.edu-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 
                inset 0 1px 1px rgba(255, 255, 255, 0.6), 
                inset 0 -1px 1px rgba(0, 0, 0, 0.25);
    font-size: 24px;
    color: #ffffff;
    animation: icon-float 8s ease-in-out infinite;
    transition: all 0.3s ease;
}

.edu-icon i {
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

@keyframes icon-float {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.icon-1 { top: 8%; inset-inline-start: 6%; animation-delay: 0s; }
.icon-2 { top: 12%; inset-inline-end: 6%; animation-delay: -1.5s; }
.icon-3 { bottom: 10%; inset-inline-start: 8%; animation-delay: -3s; }
.icon-4 { bottom: 8%; inset-inline-end: 8%; animation-delay: -4.5s; }
.icon-5 { top: 44%; inset-inline-start: 4%; animation-delay: -2.2s; width: 48px; height: 48px; font-size: 19px; }
.icon-6 { top: 50%; inset-inline-end: 4%; animation-delay: -5.5s; width: 48px; height: 48px; font-size: 19px; }

/* Frosted Brand Content Card */
.brand-content {
    position: relative;
    z-index: 3;
    max-width: 560px;
    text-align: center;
    padding: 40px 36px;
    border-radius: 28px;
    background: rgba(11, 15, 36, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 
                inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35) 0%, rgba(14, 165, 233, 0.22) 100%);
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #ffffff;
    margin-bottom: 22px;
}

.brand-content h2 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 70%, #c7d2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
}

.brand-content p {
    font-size: 15.5px;
    line-height: 1.9;
    color: rgba(241, 245, 249, 0.9);
    margin-bottom: 28px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.feature-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-chip:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.38);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* ============ Form Side (Frosted Glass Panel) ============ */
.form-side {
    flex: 0 0 46%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 40px 40px;
    position: relative;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 248, 255, 0.92) 100%);
    backdrop-filter: blur(36px) saturate(200%);
    -webkit-backdrop-filter: blur(36px) saturate(200%);
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.08);
    border-inline-end: 1px solid rgba(124, 58, 237, 0.12);
    z-index: 10;
}

.form-side::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 10%, rgba(124, 58, 237, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.language-switcher {
    position: absolute;
    top: 24px;
    z-index: 20;
}

[dir="ltr"] .language-switcher {
    right: 24px;
}

[dir="rtl"] .language-switcher {
    left: 24px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    color: #1e1b4b;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: all 0.22s ease;
}

.lang-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.18);
    transform: translateY(-1px);
}

.flag-icon {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lang-btn-text {
    font-weight: 700;
}

.lang-btn-arrow {
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.lang-dropdown.show .lang-btn-arrow {
    transform: rotate(180deg);
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    min-width: 180px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    z-index: 999;
    overflow: hidden;
    padding: 6px;
}

[dir="ltr"] .lang-menu {
    right: 0;
}

[dir="rtl"] .lang-menu {
    left: 0;
}

.lang-menu.show {
    display: block;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 10px;
    color: #1e1b4b;
    font-weight: 600;
    transition: all 0.18s ease;
}

.lang-menu a:hover {
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
    transform: translateX(-2px);
}

[dir="ltr"] .lang-menu a:hover {
    transform: translateX(2px);
}

.lang-menu a.is-active {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    cursor: default;
}

.lang-menu a .flag-icon {
    width: 22px;
    height: 16px;
}

.lang-menu-text {
    font-weight: 700;
}

.check-icon {
    margin-inline-start: auto;
    font-size: 13px;
    color: #7c3aed;
}

.form-wrap {
    width: 100%;
    max-width: 420px;
    margin: auto;
    text-align: center;
}

.form-wrap img.logo {
    max-height: 90px;
    max-width: 240px;
    margin: 0 auto 18px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(124, 58, 237, 0.15));
    transition: transform 0.3s ease;
}

.form-wrap img.logo:hover {
    transform: scale(1.03);
}

.form-wrap h1 {
    font-weight: 800;
    font-size: 32px;
    color: #1e1b4b;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.form-subtitle {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.7;
    font-weight: 500;
}

.alert-error {
    display: block;
    padding: 12px 18px;
    margin: 12px 0 0;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: start;
}

.form-group {
    margin-top: 26px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-field {
    text-align: start;
}

.input-field label {
    display: block;
    margin-bottom: 8px;
    color: #1e1b4b;
    font-weight: 700;
    font-size: 14px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap .input-icon {
    position: absolute;
    inset-inline-start: 16px;
    font-size: 18px;
    color: #7c3aed;
    opacity: 0.9;
    pointer-events: none;
    transition: all 0.25s ease;
}

.input-field input {
    width: 100%;
    padding: 14px 18px;
    padding-inline-start: 48px;
    border: 1.5px solid rgba(124, 58, 237, 0.22);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    color: #1e1b4b;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.03), inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
}

.input-wrap:focus-within .input-icon {
    color: #6d28d9;
    transform: scale(1.15);
}

.input-field input:focus {
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16), 0 4px 16px rgba(124, 58, 237, 0.1);
}

.input-field input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.input-field input[type="password"] {
    padding-inline-end: 48px;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: #7c3aed;
    font-size: 17px;
    transition: all 0.25s ease;
}

.password-toggle:hover {
    color: #4f46e5;
    transform: scale(1.15);
}

.check-field {
    text-align: start;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.check-field div {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.check-field label {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.check-field input {
    width: 20px;
    height: 20px;
    appearance: none;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.check-field input::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(124, 58, 237, 0.35);
    border-radius: 6px;
    position: absolute;
    cursor: pointer;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Font Awesome 6 Pro";
    display: flex;
    align-items: center;
    font-size: 12px;
    justify-content: center;
    background: #ffffff;
    transition: all 0.22s ease;
}

.check-field input:checked::after {
    content: "\f00c";
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}

.submit-btn {
    margin-top: 26px;
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: none;
    outline: none;
    cursor: pointer;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    box-shadow: 0 10px 26px rgba(124, 58, 237, 0.38);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(124, 58, 237, 0.52);
}

.submit-btn:active {
    transform: translateY(0) scale(0.99);
}

[dir="rtl"] .margin {
    margin-inline-end: 6px;
}

[dir="ltr"] .margin {
    margin-inline-start: 6px;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    padding: 18px 0 0;
    margin-top: 26px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.footer a {
    color: #1e1b4b;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #7c3aed;
}

.footer-logo {
    height: 18px;
    vertical-align: middle;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

/* ============ Responsive ============ */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }

    .form-side {
        order: 1;
    }

    .brand-side {
        order: 2;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .edu-icons {
        opacity: 0.5;
    }

    .brand-content h2 {
        font-size: 30px;
    }

    .form-side {
        flex: 0 0 50%;
    }
}

@media (max-width: 767px) {
    .container {
        flex-direction: column;
    }

    .brand-side {
        order: 1;
        min-height: 220px;
        padding: 36px 20px 48px;
    }

    .edu-icons {
        display: none;
    }

    .form-side {
        order: 2;
        flex: none;
        padding: 40px 24px 32px;
        border-inline-end: none;
        border-radius: 30px 30px 0 0;
        margin-top: -24px;
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.12);
    }

    .brand-content h2 {
        font-size: 24px;
    }

    .brand-content p {
        font-size: 13.5px;
        margin-bottom: 16px;
    }

    .brand-badge {
        margin-bottom: 12px;
        font-size: 12px;
        padding: 6px 14px;
    }

    .feature-chip {
        font-size: 12px;
        padding: 6px 12px;
    }

    .form-wrap {
        max-width: 100%;
    }

    .form-wrap h1 {
        font-size: 24px;
    }

    .input-field input {
        font-size: 13.5px;
        padding: 12px 16px;
        padding-inline-start: 44px;
    }

    .footer {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .brand-side {
        min-height: 200px;
    }

    .brand-content p {
        display: none;
    }

    .feature-chips {
        gap: 6px;
    }
}
