* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    /* Background Animasi Gradasi (Clean, tidak mencolok) */
    background: linear-gradient(-45deg, #1e3a8a, #3b82f6, #059669, #10b981);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #1f2937;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-result {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.container {
    /* Efek Glassmorphism */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    
    width: 100%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Header & Logo */
.logo-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
}

header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2563eb;
    margin-top: 4px;
}

header p {
    font-size: 14px;
    color: #6b7280;
    margin-top: 6px;
    margin-bottom: 25px;
}

/* Form Styling */
.input-group {
    margin-bottom: 16px;
    text-align: left;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f9fafb;
}

input:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

button {
    width: 100%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

/* Area Countdown */
.countdown-box {
    background-color: #f3f4f6;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.countdown-box h3 {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 15px;
}

.timer {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.time-block {
    background: white;
    padding: 10px;
    border-radius: 8px;
    min-width: 65px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.time-block span {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #1f2937;
}

.time-block small {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}

/* Hasil & Footer */
.hidden { display: none !important; }

.status-card { margin-top: 25px; padding: 25px 20px; border-radius: 12px; }
.status-card h3 { font-size: 16px; margin-bottom: 12px; }
.status-card .nama { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: #111827; }
.status-card .nisn { font-size: 14px; color: #6b7280; margin-bottom: 20px; }
.status-text { font-size: 32px; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 20px; }

.message-box {
    margin-top: 20px; padding: 15px; border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.5); font-size: 14px; line-height: 1.5; text-align: left;
}
.message-box strong { display: block; margin-bottom: 5px; }

.lulus { background-color: #ecfdf5; border: 1px solid #a7f3d0; }
.lulus .status-text { color: #059669; }
.lulus h3 { color: #065f46; }
.lulus .message-box { color: #065f46; border-top: 1px dashed #a7f3d0; }

.tidak-lulus { background-color: #fef2f2; border: 1px solid #fecaca; }
.tidak-lulus .status-text { color: #dc2626; }
.tidak-lulus h3 { color: #991b1b; }
.tidak-lulus .message-box { color: #991b1b; border-top: 1px dashed #fecaca; }

.not-found { background-color: #f9fafb; color: #4b5563; padding: 25px 20px; border-radius: 12px; border: 1px solid #e5e7eb; }

footer {
    margin-top: 30px;
    font-size: 12px;
    color: #9ca3af;
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}
/* --- EFEK DRAMATIS (LOADING) --- */
.dramatic-loading {
    padding: 30px 20px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(37, 99, 235, 0.1);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    margin: 0 auto 20px auto;
}

.loading-text {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    animation: pulseText 1.5s infinite;
}

.loading-subtext {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

button:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- FITUR KARTU UNDUHAN & TOMBOL --- */
.downloadable-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 25px 20px;
    border: 2px solid #e5e7eb;
    margin-bottom: 20px;
    position: relative;
    /* Penting agar background tidak transparan saat di-screenshot html2canvas */
}

.logo-group-small {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.logo-small {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.btn-share {
    background: linear-gradient(135deg, #10b981, #059669); /* Warna hijau yang fresh */
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-share:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: #6b7280;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #4b5563;
    box-shadow: 0 6px 12px rgba(75, 85, 99, 0.3);
}

/* --- DARK MODE OTOMATIS --- */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(-45deg, #0f172a, #1e3a8a, #064e3b, #0f766e);
        background-size: 400% 400%;
        color: #f9fafb;
    }
    
    .container {
        background: rgba(31, 41, 55, 0.85); /* Kaca buram gelap */
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    header h1 { color: #f9fafb; }
    header h2 { color: #60a5fa; }
    header p, label, .countdown-box h3 { color: #d1d5db; }
    
    input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    input:focus {
        background-color: #1f2937;
        border-color: #60a5fa;
    }
    
    .countdown-box { background-color: rgba(55, 65, 81, 0.5); }
    .time-block { background: #1f2937; box-shadow: none; }
    .time-block span { color: #f9fafb; }
    .time-block small { color: #9ca3af; }
    
    .loading-text { color: #f9fafb; }
    .not-found { background-color: #374151; color: #d1d5db; border-color: #4b5563; }
    
    /* Penyesuaian Kotak Hasil untuk Mode Gelap */
    .status-card.lulus { background-color: rgba(6, 95, 70, 0.2); border-color: #059669; }
    .status-card.lulus .nama, .status-card.lulus .status-text, .status-card.lulus h4, .status-card.lulus p { color: #34d399 !important; }
    
    .status-card.tidak-lulus { background-color: rgba(153, 27, 27, 0.2); border-color: #dc2626; }
    .status-card.tidak-lulus .nama, .status-card.tidak-lulus .status-text, .status-card.tidak-lulus h3 { color: #f87171 !important; }
    
    .message-box { background-color: rgba(0, 0, 0, 0.3); color: #d1d5db !important; }
}

/* --- PENYESUAIAN KHUSUS UNTUK LAYAR DESKTOP (PC/LAPTOP) --- */
@media (min-width: 768px) {
    /* 1. Melebarkan area utama agar terlihat seperti sertifikat landscape */
    .container {
        max-width: 750px; /* Diperlebar dari 450px */
        padding: 50px 60px;
        border-radius: 24px;
    }

    /* 2. Menahan lebar form pencarian agar inputnya tidak melar kepanjangan */
    #searchForm {
        max-width: 400px;
        margin: 0 auto;
    }

    /* 3. Membesarkan teks Header */
    header h1 { font-size: 32px; }
    header p { font-size: 16px; margin-bottom: 40px; }

    /* 4. Membuat jarak tabel identitas lebih lega dan elegan */
    table { margin: 30px 0 !important; }
    table td { padding: 12px 0 !important; font-size: 18px !important; }

    /* 5. Membesarkan teks nama dan status LULUS agar sangat mencolok di PC */
    .status-card .nama { font-size: 32px !important; }
    .status-text { font-size: 64px !important; margin: 30px 0 20px 0 !important; }
    
    /* 6. Membesarkan kotak hitung mundur */
    .time-block { min-width: 85px; padding: 15px; }
    .time-block span { font-size: 36px; }
    
    /* 7. Membesarkan logo */
    .logo { height: 80px; }
    .logo-small { height: 50px; }
}