:root {
    --primary: #6366f1;
    --primary-dark: #4338ca;
    --primary-light: #a5b4fc;
    --navy-1: #1e293b;
    --navy-2: #334155;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    background: url('https://images.unsplash.com/photo-1713018604446-198b165aa772?fm=jpg&q=80&w=1920&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 0;
}

/* ---------- Animated background shapes ---------- */
.bg-shapes {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    animation: float 14s ease-in-out infinite;
}

.shape-1 {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -100px;
    background: #6366f1;
}

.shape-2 {
    width: 360px;
    height: 360px;
    bottom: -120px;
    right: -80px;
    background: #818cf8;
    animation-delay: -4s;
}

.shape-3 {
    width: 260px;
    height: 260px;
    top: 55%;
    left: 12%;
    background: #3b82f6;
    animation-delay: -8s;
}

.shape-4 {
    width: 180px;
    height: 180px;
    top: 12%;
    right: 16%;
    background: #22d3ee;
    opacity: 0.25;
    animation-delay: -11s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -35px) scale(1.06); }
    50%      { transform: translate(-25px, 20px) scale(0.96); }
    75%      { transform: translate(20px, 30px) scale(1.04); }
}

/* ---------- Card ---------- */
.login-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 400px 1fr;
    max-width: 960px;
    width: 100%;
    min-height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(36px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Brand panel (left) ---------- */
.brand-panel {
    display: flex;
    flex-direction: column;
    padding: 48px 40px;
    background: linear-gradient(160deg, var(--navy-2) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 60px solid rgba(255, 255, 255, 0.08);
    bottom: -120px;
    right: -120px;
}

/* ---------- School profile (left) ---------- */
.school-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 28px;
    animation: fadeSlide 0.8s 0.15s ease both;
}

.school-logo {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.school-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.school-name {
    font-size: 25px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.school-tagline {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------- Afghanistan badge ---------- */
.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: center;
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    padding: 11px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    animation: fadeSlide 0.8s 0.35s ease both;
}

.flag-stripes {
    display: flex;
    width: 22px;
    height: 15px;
    border-radius: 3px;
    overflow: hidden;
}

.stripe {
    flex: 1;
}

.stripe-black {
    background: #000000;
}

.stripe-red {
    background: #d32011;
}

.stripe-green {
    background: #007a36;
}

/* ---------- Developer info ---------- */
.developer-info {
    margin-top: 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
}

.dev-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    margin-bottom: 8px;
}

.dev-company {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.dev-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dev-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.4;
}

.dev-item svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.brand-footer {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.5);
}

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

/* ---------- Form panel (right) ---------- */
.form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px;
    background: #ffffff;
}

.mobile-logo {
    display: none;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy-2), var(--primary));
    border-radius: 16px;
    margin-bottom: 22px;
}

.form-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 14.5px;
    color: var(--text-gray);
    margin-bottom: 30px;
}

/* ---------- Error ---------- */
.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger);
    color: var(--danger);
    font-size: 13.5px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 22px;
    animation: shake 0.45s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.login-success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    color: #16a34a;
    font-size: 13.5px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 22px;
}

/* ---------- Form fields ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    color: #9ca3af;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-dark);
    background: #f9fafb;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.input-wrapper input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.field-validation-error {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--danger);
    margin-top: 6px;
}

/* ---------- Password toggle ---------- */
.input-wrapper input[type="password"],
.input-wrapper input[type="text"]#passwordInput {
    padding-right: 46px;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

.toggle-password {
    position: absolute;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.toggle-password:hover {
    color: var(--primary);
    background-color: #eef2ff;
}

/* ---------- Remember me / forgot row ---------- */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    color: transparent;
    cursor: pointer;
    transition: all 0.18s ease;
}

.remember-me input:checked ~ .checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.remember-me input:focus-visible ~ .checkbox-box {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.forgot-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ---------- Login button ---------- */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    font-size: 15.5px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.2px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-login::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.42);
}

.btn-login:hover::before {
    transform: translateX(120%);
}

.btn-login:active {
    transform: translateY(0);
}

/* ---------- Divider + register ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-gray);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-register {
    display: block;
    text-align: center;
    width: 100%;
    padding: 13px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--primary);
    background: #eef2ff;
    border: 1.5px dashed var(--primary-light);
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-register:hover {
    background: var(--primary);
    border-style: solid;
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

/* ---------- Validation (jQuery) ---------- */
.input-validation-error {
    border-color: var(--danger) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .login-card {
        grid-template-columns: 1fr;
        max-width: 480px;
        min-height: auto;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: 40px 32px;
    }

    .mobile-logo {
        display: flex;
    }

    .brand-footer {
        display: block;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 14px 10px;
    }

    .form-panel {
        padding: 34px 22px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
