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

body {
    font-family: 'Inter', sans-serif;
    color: #333;
    line-height: 1.6;
    padding: 15px;
    min-height: 100vh;
    background-color: #1e3a8a;
    background-image: url('assets/image/BG-WEB-QUIZ.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    image-rendering: optimizeSpeed;
    image-rendering: -webkit-optimize-contrast;
}

/* Critical background loading */
@media (max-width: 768px) {
    body {
        background-image: url('assets/image/BG-WEB-QUIZ.png');
        background-attachment: scroll;
        background-size: cover;
        will-change: auto;
    }
}

/* iOS Safari background fix */
@supports (-webkit-touch-callout: none) {
    body {
        background-attachment: scroll;
        background-size: cover;
        min-height: -webkit-fill-available;
        transform: translateZ(0);
    }
}

/* Disable scroll on desktop */
@media (min-width: 1024px) {
    body {
        overflow: hidden;
        height: 100vh;
    }
}

/* Mobile First Design */
section {
    background: white;
    padding: 25px 20px;
    max-width: 500px;
    margin: 0 auto 20px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(11, 94, 145, 0.1);
    border: 2px solid #0b5e91;
}

/* Main Container Layout */
.main-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
    padding: 80px 0px;
}

/* Welcome Section */
.welcome-section {
    flex: 1;
}

.welcome-text {
    text-align: justify;
    color: #ffffff;
}

/* Typewriter Animation */
.typewriter {
    overflow: hidden;
    animation: typewriter 4s steps(150) 1s both;
}

@keyframes typewriter {
    0% { max-height: 0; opacity: 0; }
    100% { max-height: 200px; opacity: 1; }
}

.right-column {
    flex: 1;
}

#form-section {
    max-width: none;
    margin: 50px 0px;
}

.karakter-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 15px;
    margin-top: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.3s ease;
}

.karakter-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    min-height: 200px;
    opacity: 0.8;
    border-radius: 15px;
}

.karakter-image:not(.loading) {
    animation: fadeIn 0.5s ease-in;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scroll Down Button */
.scroll-down-btn {
    display: block;
    margin: 15px auto 0;
    padding: 12px 20px;
    border-radius: 25px;
    background: #0b5e91;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(11, 94, 145, 0.3);
    animation: bounce 2s infinite;
    white-space: nowrap;
}

.scroll-down-btn:active {
    transform: scale(0.9);
    transition: transform 0.1s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Hide button on desktop */
@media (min-width: 769px) {
    .scroll-down-btn {
        display: none;
    }
}

/* Music Toggle Button */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(11, 94, 145, 0.9);
    color: white;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(11, 94, 145, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.music-toggle:active {
    transform: scale(0.95);
}

.music-toggle.muted {
    background: rgba(108, 117, 125, 0.9);
}

h2 {
    font-family: 'Philosopher', serif;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

h3 {
    font-family: 'Philosopher', serif;
    font-weight: 700;
    color: #0b5e91;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

h4 {
    font-family: 'Philosopher', serif;
    font-weight: 600;
    color: #0b5e91;
    font-size: 1.2rem;
}

/* Form Styling */
input {
    width: 100%;
    padding: 15px 18px;
    margin: 12px 0;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: #fafafa;
}

input:focus {
    outline: none;
    border-color:karakter-image #0b5e91;
    background: white;
}

input::placeholder {
    color: #999;
    font-weight: 400;
}

/* WhatsApp Info */
.wa-info {
    display: block;
    font-size: 12px;
    color: #0b5e91;
    margin-top: -8px;
    margin-bottom: 12px;
    text-align: left;
    font-weight: 500;
    line-height: 1.3;
}

/* Button Styling */
button {
    font-weight: 400;
    font-size: 16px;
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    min-height: 50px;
}

button[type="submit"] {
    width: 100%;
    background: #0b5e91;
    color: white;
    font-size: 18px;
    margin-top: 15px;
}



/* Quiz Question */
#pertanyaan {
    font-family: 'Philosopher', serif;
    font-size: 1.1rem;
    color: #0b5e91;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}

/* Answer Buttons */
.pilihan-btn {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    background: white;
    border: 2px solid #ddd;
    color: #333;
    text-align: left;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.3;
    min-height: auto;
}



.pilihan-btn.selected {
    background: #0b5e91;
    color: white;
    border-color: #0b5e91;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button-group button {
    flex: 1;
    min-width: 120px;
}

.back-btn {
    background: #6c757d;
    color: white;
}



#nextBtn {
    background: #0b5e91;
    color: white;
}



/* Results Section */
#hasilText {
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    text-align: left;
    margin: 10px 0;
    font-size: 14px;
    color: #333;
}

#hasilText strong {
    color: #0b5e91;
    font-size: 1.1em;
    font-family: 'Philosopher', serif;
    display: block;
    margin-bottom: 8px;
}

/* Hidden Class */
.hidden {
    display: none;
}

/* Progress Indicator */
#quiz-section h2 {
    background: #0b5e91;
    color: white;
    padding: 12px;
    border-radius: 12px;
    margin: -25px -20px 18px -20px;
    font-size: 1.1rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        gap: 1rem;
    }

    .right-column {
        width: 100%;
    }

    #form-section {
        max-width: 500px;
        margin: 0 auto;
    }

    .welcome-section {
        margin: 0 auto;
    }
}

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

    section {
        padding: 20px 15px;
        margin: 0 auto 15px;
    }

    h2 {
        font-size: 1.8rem;
    }

    #pertanyaan {
        font-size: 1.1rem;
    }

    .pilihan-btn {
        padding: 15px 18px;
        font-size: 14px;
    }
}

/* Smooth Animations */
section {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus States for Accessibility */
button:focus,
input:focus {
    outline: 2px solid #0b5e91;
    outline-offset: 2px;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Share Section */
.share-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.share-section h3 {
    font-family: 'Philosopher', serif;
    color: #0b5e91;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-btn {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    color: white;
}

.wa-btn {
    background: #25D366;
}

.ig-btn {
    background: #E4405F;
}

.tiktok-btn {
    background: #000000;
}

/* Mobile share buttons */
@media (max-width: 480px) {
    .share-buttons {
        gap: 10px;
    }

    .share-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
}