:root {
    --primary-navy: #0f2e5a;
    --primary-blue: #1d4ed8;
    --accent-teal: #0d9488;
    --accent-amber: #d97706;
    --bg-page: #f1f5f9;
    --card-bg: #ffffff;
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --success: #15803d;
    --danger: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Mobile App Frame */
.app-container {
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative;
}
/* App Header - Navy with Emerald Accent */
.app-header {
    background: linear-gradient(135deg, #0a192f 0%, #0f2e5a 60%, #1d4ed8 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 2px solid #0d9488;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1d4ed8 0%, #0d9488 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.brand-icon svg { width: 22px; height: 22px; }

.brand-info h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-info p {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Timer Badge */
.timer-badge {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 6px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-badge svg { width: 16px; height: 16px; }

/* Main Content Area */
.content {
    flex: 1;
    padding: 22px 20px;
    overflow-y: auto;
}

/* Exam Card */
.exam-card {
    background: white;
    border: 1px solid var(--border-light);
    border-left: 4px solid #1d4ed8;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.exam-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.exam-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}

.exam-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.exam-meta svg { width: 15px; height: 15px; color: #0d9488; }

/* Buttons */
.btn {
    width: 100%;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: #1d4ed8;
    color: white;
}
.btn-primary:active {
    background: #1e40af;
}

.btn-teal {
    background: #0d9488;
    color: white;
}

.btn-success {
    background: #15803d;
    color: white;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-heading);
}

/* Question Area */
.question-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-heading);
    font-weight: 600;
    margin-bottom: 16px;
}

.question-img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    margin-bottom: 14px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border);
}

/* RTL Arab & Mandarin Fonts */
.text-arabic {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    direction: rtl;
    text-align: right;
    font-size: 1.45rem !important;
    line-height: 1.9 !important;
}

.text-mandarin {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 1.25rem !important;
}

/* Option Buttons A, B, C, D, E */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.opt-btn {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.opt-btn:active {
    background: #eff6ff;
}

.opt-btn.selected {
    background: #eff6ff;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}

.opt-circle {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: white;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.opt-btn.selected .opt-circle {
    background: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
}

.opt-text {
    font-size: 0.92rem;
    color: var(--text-heading);
    line-height: 1.4;
    flex-grow: 1;
}

/* Question Grid Navigator */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.grid-num {
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.grid-num.current {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: white;
}

.grid-num.answered {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

/* Alarm & Cheat Warning Banner */
.cheat-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(185, 28, 28, 0.96);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: white;
}

.cheat-box {
    background: white;
    color: #991b1b;
    padding: 32px 24px;
    border-radius: 16px;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.cheat-box svg {
    width: 60px;
    height: 60px;
    color: #dc2626;
    margin-bottom: 12px;
}

.cheat-box h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.cheat-box p {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Nav Buttons */
.nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }

/* ========================================================
   ANIMASI KHUSUS HALAMAN LOGIN SISWA
   ======================================================== */
.login-animated-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #09172e 0%, #0f2e5a 45%, #0b3d59 100%);
    background-size: 200% 200%;
    animation: bgGradientMove 10s ease infinite;
    z-index: 100;
}

@keyframes bgGradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Ambient Orbs */
.anim-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 1;
}

.anim-orb-1 {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, #0d9488 0%, rgba(13,148,136,0) 70%);
    top: -50px;
    left: -60px;
    animation: orbFloat1 8s ease-in-out infinite alternate;
}

.anim-orb-2 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #2563eb 0%, rgba(37,99,235,0) 70%);
    bottom: -60px;
    right: -80px;
    animation: orbFloat2 9s ease-in-out infinite alternate;
}

.anim-orb-3 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #10b981 0%, rgba(16,185,129,0) 70%);
    top: 55%;
    left: 75%;
    animation: orbFloat3 7s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 50px) scale(1.15); }
}

@keyframes orbFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, -40px) scale(1.2); }
}

@keyframes orbFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 30px) scale(0.9); }
}

/* Animated Login Card */
.login-card-animated {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 36px 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    position: relative;
    z-index: 10;
    animation: cardEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulsing School Logo */
.login-logo-pulsing {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.pulsing-school-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 16px;
    padding: 4px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.25);
    animation: logoGlowPulse 3s ease-in-out infinite;
}

@keyframes logoGlowPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 6px 18px rgba(13, 148, 136, 0.25);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 14px 30px rgba(13, 148, 136, 0.55), 0 0 20px rgba(37, 99, 235, 0.3);
    }
}

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

.badge-animated-welcome {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);
    color: #0d9488;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(13,148,136,0.15);
}

.school-title-animated {
    color: #0f2e5a;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.school-subtitle-animated {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.4;
}

/* Input Fields Animated */
.animated-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.animated-input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

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

.input-with-icon svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.3s;
}

.form-control-animated {
    width: 100%;
    padding: 13px 14px 13px 42px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #0f172a;
    transition: all 0.3s ease;
    outline: none;
}

.form-control-animated:focus {
    background: #ffffff;
    border-color: #0d9488;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.input-with-icon:focus-within svg {
    color: #0d9488;
}

/* Animated Shimmer Login Button */
.btn-animated-shimmer {
    margin-top: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f2e5a 0%, #1d4ed8 50%, #0d9488 100%);
    background-size: 200% auto;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 46, 90, 0.3);
    transition: all 0.4s ease;
    animation: btnShimmerPulse 4s linear infinite;
}

@keyframes btnShimmerPulse {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.btn-animated-shimmer:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 46, 90, 0.4);
}

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

.login-info-pill-animated {
    margin-top: 20px;
    background: rgba(240, 253, 244, 0.9);
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.login-info-pill-animated svg {
    flex-shrink: 0;
    color: #16a34a;
}
