/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 1080px;
    height: 1920px;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    position: relative;
}

/* ===== GLASS ANIMATED BACKGROUND (60fps via transform/opacity only) ===== */
.bg-layer {
    position: fixed;
    inset: 0;
    width: 1080px;
    height: 1920px;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* BRAND-COLORED SHINE SWEEP (blue -> cyan -> green) */
.bg-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 25%,
        rgba(0, 63, 138, 0.06) 33%,
        rgba(0, 191, 255, 0.12) 42%,
        rgba(59, 170, 53, 0.10) 50%,
        rgba(0, 191, 255, 0.12) 58%,
        rgba(0, 63, 138, 0.06) 67%,
        transparent 75%
    );
    animation: bgShine 8s ease-in-out infinite;
    will-change: transform;
    pointer-events: none;
}

@keyframes bgShine {
    0% { transform: translate3d(-60%, -60%, 0) rotate(45deg); }
    100% { transform: translate3d(60%, 60%, 0) rotate(45deg); }
}

.glass-orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    backface-visibility: hidden;
    filter: blur(80px);
    opacity: 0.22;
}

.orb1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #00BFFF 0%, transparent 70%);
    top: -100px; left: -100px;
    animation: floatOrb1 18s ease-in-out infinite;
}
.orb2 {
    width: 450px; height: 450px;
    background: radial-gradient(circle, #3BAA35 0%, transparent 70%);
    bottom: 200px; right: -80px;
    animation: floatOrb2 22s ease-in-out infinite;
}
.orb3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #003F8A 0%, transparent 70%);
    top: 600px; left: 300px;
    animation: floatOrb3 20s ease-in-out infinite;
}
.orb4 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #00BFFF 0%, transparent 70%);
    bottom: -50px; left: 100px;
    animation: floatOrb4 16s ease-in-out infinite;
}
.orb5 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #3BAA35 0%, transparent 70%);
    top: 300px; right: 50px;
    animation: floatOrb5 24s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(200px, 300px, 0) scale(1.15); }
    66% { transform: translate3d(80px, 500px, 0) scale(0.9); }
}
@keyframes floatOrb2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(-180px, -200px, 0) scale(1.1); }
    66% { transform: translate3d(-50px, -400px, 0) scale(0.95); }
}
@keyframes floatOrb3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-200px, 250px, 0) scale(1.2); }
}
@keyframes floatOrb4 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(300px, -200px, 0) scale(1.1); }
}
@keyframes floatOrb5 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.22; }
    50% { transform: translate3d(-150px, -300px, 0) scale(0.85); opacity: 0.14; }
}

/* ===== PAGE CONTAINER ===== */
.page {
    position: absolute;
    inset: 0;
    width: 1080px;
    height: 1920px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* ===== GLASS CARD MIXIN ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 63, 138, 0.08);
}

/* ===================================================
   PAGE 1 : HOME
   =================================================== */
.home-logo-wrap {
    margin-top: 80px;
    cursor: pointer;
    user-select: none;
    animation: logoFloat 4s ease-in-out infinite;
    will-change: transform;
}

@keyframes logoFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
}

.home-logo {
    width: 520px;
    height: auto;
}

.sub-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 150px;
    padding: 0 50px;
    max-width: 1000px;
}

.sub-card {
    width: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    animation: cardEntrance 0.6s ease-out both;
}
.sub-card:nth-child(1) { animation-delay: 0.05s; }
.sub-card:nth-child(2) { animation-delay: 0.1s; }
.sub-card:nth-child(3) { animation-delay: 0.15s; }
.sub-card:nth-child(4) { animation-delay: 0.2s; }
.sub-card:nth-child(5) { animation-delay: 0.25s; }
.sub-card:nth-child(6) { animation-delay: 0.3s; }
.sub-card:nth-child(7) { animation-delay: 0.35s; }
.sub-card:nth-child(8) { animation-delay: 0.4s; }
.sub-card:nth-child(9) { animation-delay: 0.45s; }
.sub-card:nth-child(10) { animation-delay: 0.5s; }
.sub-card:nth-child(11) { animation-delay: 0.55s; }

@keyframes cardEntrance {
    0% { opacity: 0; transform: translate3d(0, 40px, 0) scale(0.9); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.sub-card:active {
    transform: scale(0.95);
}

.sub-card-inner {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 63, 138, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer sweep on each card */
.sub-card-inner::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.12), rgba(59, 170, 53, 0.08), transparent);
    animation: cardShimmer 5s ease-in-out infinite;
    will-change: transform;
    pointer-events: none;
}
.sub-card:nth-child(odd) .sub-card-inner::after { animation-delay: 0s; }
.sub-card:nth-child(even) .sub-card-inner::after { animation-delay: 2.5s; }

@keyframes cardShimmer {
    0%, 60%, 100% { transform: translate3d(0, 0, 0); }
    80% { transform: translate3d(500px, 0, 0); }
}

.sub-card.selected .sub-card-inner {
    border-color: #003F8A;
    box-shadow: 0 0 0 3px rgba(0, 63, 138, 0.25), 0 8px 32px rgba(0, 63, 138, 0.15);
}

.sub-card-inner img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sub-label {
    margin-top: 10px;
    font-size: 23px;
    font-weight: 600;
    color: #1a1a2e;
    text-align: center;
    line-height: 1.2;
}

/* NEXT BUTTON — glow + pulse + shine */
.btn-next {
    margin-top: 100px;
    width: 500px;
    height: 90px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #003F8A 0%, #3BAA35 100%);
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: btnPulse 2.5s ease-in-out infinite;
    will-change: transform;
    box-shadow: 0 0 30px rgba(0, 63, 138, 0.3), 0 0 60px rgba(59, 170, 53, 0.15);
}
.btn-next::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: btnShine 3s ease-in-out infinite;
    will-change: transform;
}
.btn-next:disabled {
    opacity: 0.35;
    cursor: default;
    animation: none;
    box-shadow: none;
}
.btn-next:disabled::after {
    animation: none;
}

@keyframes btnPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(0, 63, 138, 0.3), 0 0 60px rgba(59, 170, 53, 0.15); }
    15% { transform: scale(1.05) rotate(-0.5deg); box-shadow: 0 0 45px rgba(0, 63, 138, 0.4), 0 0 80px rgba(59, 170, 53, 0.25); }
    30% { transform: scale(1) rotate(0.5deg); }
    45% { transform: scale(1.04) rotate(0deg); box-shadow: 0 0 40px rgba(0, 63, 138, 0.35), 0 0 70px rgba(59, 170, 53, 0.2); }
    60% { transform: scale(1); }
}
@keyframes btnShine {
    0%, 65%, 100% { transform: translate3d(0, 0, 0); }
    85% { transform: translate3d(500px, 0, 0); }
}

/* ===== ADMIN PANEL ===== */
.admin-overlay {
    position: fixed;
    inset: 0;
    width: 1080px;
    height: 1920px;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-panel {
    width: 700px;
    max-height: 1400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 63, 138, 0.15);
    padding: 40px;
}

.admin-panel h3 {
    font-size: 28px;
    color: #003F8A;
    margin-bottom: 30px;
    text-align: center;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 63, 138, 0.08);
}

.admin-row span {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
}

.admin-counter {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-counter button {
    width: 40px;
    height: 40px;
    border: 2px solid #003F8A;
    border-radius: 10px;
    background: #fff;
    color: #003F8A;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.admin-counter span {
    font-size: 24px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.btn-save-admin {
    display: block;
    margin: 30px auto 0;
    padding: 14px 60px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #003F8A, #3BAA35);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
}

.admin-saved-msg {
    text-align: center;
    margin-top: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #3BAA35;
}

.btn-close {
    display: block;
    margin: 30px auto 0;
    padding: 12px 50px;
    border: 2px solid #003F8A;
    border-radius: 14px;
    background: transparent;
    color: #003F8A;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

/* ===================================================
   PAGE 2 : FORM
   =================================================== */
.form-top-logo {
    margin-top: 120px;
}

.form-top-logo img {
    max-height: 200px;
    max-width: 620px;
    width: auto;
    object-fit: contain;
}

.form-card {
    margin-top: 350px;
    width: 900px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 63, 138, 0.08);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-card h2 {
    font-size: 46px;
    color: #003F8A;
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    width: 100%;
    margin-bottom: 14px;
    text-align: center;
}

.form-group label {
    display: block;
    font-size: 34px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    height: 70px;
    border: 2px solid rgba(0, 63, 138, 0.15);
    border-radius: 14px;
    padding: 0 24px;
    font-size: 36px;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    caret-color: transparent;
}

.form-group input.input-active {
    border-color: #003F8A;
    box-shadow: 0 0 0 3px rgba(0, 63, 138, 0.15);
}

/* Error flash */
.input-error-flash input {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25) !important;
    animation: inputFlash 0.4s ease-in-out 3;
}

@keyframes inputFlash {
    0%, 100% { box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0.4); }
}

.field-error {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 600;
    color: #e74c3c;
    text-align: center;
}

/* ===== CUSTOM KEYBOARD ===== */
.kb-wrap {
    width: 100%;
    margin-bottom: 18px;
    padding: 14px 10px;
    background: rgba(0, 63, 138, 0.06);
    border-radius: 16px;
}

.kb-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}
.kb-row:last-child {
    margin-bottom: 0;
}
.kb-row-center {
    justify-content: center;
}

.kb-key {
    min-width: 68px;
    height: 62px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #003F8A;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.1s ease;
    box-shadow: 0 2px 6px rgba(0, 63, 138, 0.08);
}
.kb-key:active {
    transform: scale(0.92);
    background: rgba(0, 63, 138, 0.12);
}

.kb-backspace {
    min-width: 80px;
    background: rgba(0, 63, 138, 0.1);
    color: #003F8A;
    font-size: 28px;
}

.kb-space {
    flex: 1;
    max-width: 440px;
    font-size: 20px;
    letter-spacing: 3px;
}

.kb-done {
    min-width: 160px;
    background: linear-gradient(135deg, #003F8A, #3BAA35);
    color: #fff;
    font-size: 22px;
    letter-spacing: 2px;
}
.kb-done:active {
    transform: scale(0.92);
    background: linear-gradient(135deg, #002d6b, #2d8a2a);
}

.btn-start {
    margin-top: 14px;
    width: 440px;
    height: 90px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #003F8A 0%, #3BAA35 100%);
    color: #fff;
    font-size: 41px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.btn-start:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ===================================================
   PAGE 3 : QUIZ
   =================================================== */
.quiz-top-logo {
    margin-top: 60px;
}

.quiz-top-logo img {
    max-height: 140px;
    max-width: 500px;
    width: auto;
    object-fit: contain;
}

.quiz-progress {
    margin-top: 160px;
    width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-weight: 600;
    color: #003F8A;
}

.q-counter {
    font-size: 46px;
    font-weight: 700;
}

.timer-bar-wrap {
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: rgba(0, 63, 138, 0.1);
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #3BAA35, #00BFFF);
    transition: width 1s linear;
    will-change: width;
}

.timer-text {
    font-size: 110px;
    font-weight: 800;
    color: #003F8A;
    transition: color 0.3s ease;
}

.timer-danger {
    color: #e74c3c !important;
    animation: timerBlink 0.6s ease-in-out infinite;
    will-change: opacity;
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.time-over-banner {
    margin-top: 10px;
    font-size: 48px;
    font-weight: 800;
    color: #e74c3c;
    letter-spacing: 4px;
    text-align: center;
    animation: timerBlink 0.8s ease-in-out 3;
}

.quiz-card {
    margin-top: 20px;
    width: 960px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 63, 138, 0.08);
    padding: 50px 40px;
}

.q-text {
    font-size: 38px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a2e;
    margin-bottom: 40px;
    text-align: center;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    min-height: 80px;
    padding: 18px 24px;
    border: 2px solid rgba(0, 63, 138, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.option-btn:not(:disabled):hover {
    border-color: rgba(0, 63, 138, 0.3);
}

.opt-key {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #003F8A, #00BFFF);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.opt-text {
    font-size: 32px;
    font-weight: 500;
    line-height: 1.3;
    color: #1a1a2e;
}

/* Answer states */
.selected-opt {
    border-color: #003F8A;
    background: rgba(0, 63, 138, 0.08);
}

.correct-opt {
    border-color: #3BAA35 !important;
    background: rgba(59, 170, 53, 0.12) !important;
}

.correct-opt .opt-key {
    background: linear-gradient(135deg, #3BAA35, #2d8a2a);
}

.wrong-opt {
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.1) !important;
}

.wrong-opt .opt-key {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.timeout-opt {
    border-color: rgba(0, 0, 0, 0.08) !important;
    background: rgba(0, 0, 0, 0.03) !important;
    opacity: 0.5;
}

/* ===================================================
   PAGE 4 : RESULTS
   =================================================== */
.result-logo {
    margin-top: 200px;
}

.result-logo img {
    max-height: 200px;
    max-width: 500px;
    width: auto;
    object-fit: contain;
}

.result-card {
    margin-top: 80px;
    width: 750px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 63, 138, 0.08);
    padding: 60px 40px;
    text-align: center;
}

.result-card h2 {
    font-size: 44px;
    color: #003F8A;
    margin-bottom: 20px;
}

.result-name {
    font-size: 36px;
    font-weight: 600;
    color: #3BAA35;
    margin-bottom: 40px;
}

.score-circle {
    width: 260px;
    height: 260px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #003F8A, #3BAA35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 63, 138, 0.2);
}

.score-num {
    font-size: 80px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.score-denom {
    font-size: 36px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.result-msg {
    font-size: 34px;
    font-weight: 700;
    color: #003F8A;
}
