
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* School Brand Colors */
    --primary: #6c6ce5;
    --primary-hover: #4848e9;
    --panel-bg: linear-gradient(160deg, #4f46e5 0%, #6c6ce5 45%, #8b5cf6 100%); /* Vibrant indigo-violet */
    --btn-gradient: linear-gradient(135deg, #6c6ce5 0%, #4848e9 100%);
    --btn-hover: linear-gradient(135deg, #4848e9 0%, #3232cc 100%);
    
    --accent-blue: #6c6ce5;
    --accent-teal: #14b8a5;
    --accent-gold: #f59e0b;
    
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-input: #e2e8f0;
    --border-focus: #6c6ce5;
    
    --radius-pill: 50px;
    --radius-card: 28px;
    --shadow-card: 0 25px 60px -15px rgba(108, 108, 229, 0.18), 0 10px 30px -10px rgba(20, 184, 165, 0.10);
    --shadow-btn: 0 8px 20px -4px rgba(108, 108, 229, 0.45);
}

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    background-color: #f1f5f9;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(108, 108, 229, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(20, 184, 165, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(30, 41, 56, 0.04) 0%, transparent 60%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 16px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Background Abstract Waves */
.bg-wave {
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.bg-wave-1 {
    top: -120px;
    left: -120px;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(108, 108, 229, 0.22) 0%, rgba(72, 72, 233, 0.12) 50%, transparent 70%);
    filter: blur(60px);
    border-radius: 50%;
}

.bg-wave-2 {
    bottom: -150px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(20, 184, 165, 0.22) 0%, rgba(30, 41, 56, 0.10) 50%, transparent 70%);
    filter: blur(70px);
    border-radius: 50%;
}

/* Main Card Container */
.login-wrapper {
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 1;
    margin: auto;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    min-height: 560px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    position: relative;
}

/* ----------------------------------------------------
   Left Visual Panel (Curved Gradient & Slogan)
------------------------------------------------------- */
.login-visual-pane {
    flex: 1.1;
    background: var(--panel-bg);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow: hidden;
    gap: 0;
}

/* Decorative curved wave overlay */
.login-visual-pane::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

/* Avatar illustration on left panel */
.visual-avatar-img {
    width: 85%;
    max-width: 270px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    margin-bottom: 12px;
    filter: drop-shadow(0 16px 28px rgba(0,0,0,0.3));
    animation: floatAvatar 5s ease-in-out infinite;
}

@keyframes floatAvatar {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

.visual-circle-cutout {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* School Crest Image */
.school-crest-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.visual-circle-cutout h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 3px;
    letter-spacing: -0.2px;
}

.visual-circle-cutout p {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
    font-weight: 500;
}

/* ----------------------------------------------------
   Right Form Panel
------------------------------------------------------- */
.login-form-pane {
    flex: 1;
    background: var(--bg-card);
    padding: 46px 44px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* Top Avatar Icon (replacing user image with sleek school badge) */
.form-top-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(108, 108, 229, 0.08);
    border: 2px solid rgba(108, 108, 229, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--accent-blue);
    font-size: 26px;
    box-shadow: 0 6px 16px rgba(108, 108, 229, 0.12);
    overflow: hidden;
}

.form-top-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.form-header-text {
    text-align: center;
    margin-bottom: 24px;
}

.form-header-text h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.form-header-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Alerts */
.alert-box {
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.82rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.alert-box.error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #dc2626;
}

.alert-box.success {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #15803d;
}

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

/* Pill Input Groups */
.pill-input-group {
    position: relative;
    margin-bottom: 16px;
}

.pill-input-group input {
    width: 100%;
    height: 48px;
    background: #f8fafc;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-pill);
    padding: 0 44px 0 22px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
}

.pill-input-group input::placeholder {
    color: #94a3b8;
    font-size: 0.88rem;
}

.pill-input-group input:focus {
    background: #ffffff;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.pill-input-group .input-icon-right {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.25s ease;
}

.pill-input-group input:focus ~ .input-icon-right {
    color: var(--primary);
}

.toggle-password-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--primary);
}

/* Options Bar (Remember Me & Forgot Link) */
.form-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.82rem;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
}

.remember-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.link-forgot {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

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

/* OTP Input Styling */
.otp-input-wrap {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.otp-input {
    width: 100%;
    max-width: 280px;
    height: 54px;
    background: #f8fafc;
    border: 2px solid var(--border-input);
    border-radius: var(--radius-pill);
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 12px;
    color: var(--accent-blue);
    outline: none;
    transition: all 0.25s ease;
}

.otp-input:focus {
    background: #ffffff;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Big Pill Submit Button */
.pill-submit-btn {
    width: 100%;
    height: 48px;
    background: var(--btn-gradient);
    border: none;
    border-radius: var(--radius-pill);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-btn);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.pill-submit-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(37, 99, 235, 0.5);
}

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

/* Bottom Help & Links */
.help-links-section {
    text-align: center;
    margin-top: 18px;
}

.help-links-section p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.help-links-section a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.82rem;
}

.help-links-section a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Card Footer */
.card-bottom-footer {
    text-align: center;
    padding-top: 20px;
    margin-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.card-bottom-footer p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ----------------------------------------------------
   Responsive Layout (Mobile & Tablet)
------------------------------------------------------- */
@media (max-width: 860px) {
    .login-wrapper {
        max-width: 480px;
    }

    .login-card {
        flex-direction: column;
        min-height: auto;
    }

    /* Remove PNG avatar and left visual banner on smaller screens */
    .visual-avatar-img,
    .login-visual-pane {
        display: none !important;
    }

    .login-form-pane {
        padding: 40px 28px 30px;
    }
}
