@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary:       #4f46e5;
    --primary-dark:  #3730a3;
    --primary-light: #818cf8;
    --primary-soft:  #eef2ff;
    --success:       #10b981;
    --success-dark:  #059669;
    --danger:        #ef4444;
    --bg:            #f5f7ff;
    --card-bg:       #ffffff;
    --border:        #e8ecf4;
    --text-main:     #0f172a;
    --text-muted:    #64748b;
    --text-light:    #94a3b8;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 10% 10%, rgba(79, 70, 229, 0.08) 0px, transparent 55%),
        radial-gradient(ellipse at 90% 90%, rgba(14, 165, 233, 0.06) 0px, transparent 55%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
}

/* =========================================
   CARD
   ========================================= */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 460px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 10px 30px rgba(79, 70, 229, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 20px 40px rgba(79, 70, 229, 0.12);
}

/* Hide/show states */
.card.is-hidden {
    display: none;
}

/* =========================================
   LOGO / HEADER
   ========================================= */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-soft);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.logo-icon i {
    font-size: 1.6rem;
    color: var(--primary);
}

.logo-section h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.logo-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* =========================================
   FORM
   ========================================= */
.form-group {
    margin-bottom: 20px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field-label i {
    font-size: 0.85rem;
    color: var(--primary);
}

input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    line-height: 1;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

input[type="text"]::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

/* CAPTCHA */
.captcha-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    align-items: stretch;
}

.captcha-box {
    background: #f1f5f9;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    transition: border-color 0.2s;
    position: relative;
}

.captcha-box:hover {
    border-color: var(--primary-light);
}

.captcha-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.captcha-refresh-hint {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 0.6rem;
    color: var(--text-light);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    width: 100%;
    text-decoration: none;
    line-height: 1;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: #fff;
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: #c7d0e0;
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1.5px solid #c7d2fe;
}

.btn-secondary:hover {
    background: #e0e7ff;
}

/* =========================================
   LOADER SPINNER
   ========================================= */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   RESULT CARD
   ========================================= */
.result-header {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.status-pill.lulus {
    background: #dcfce7;
    color: #15803d;
}

.status-pill.tidak-lulus {
    background: #fee2e2;
    color: #b91c1c;
}

.student-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 3px;
}

.result-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Data grid */
.data-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.data-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.data-row .d-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.data-row .d-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Action buttons */
.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeUp 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* =========================================
   FOOTER
   ========================================= */
.page-footer {
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

/* =========================================
   CONFETTI CANVAS
   ========================================= */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    body { padding: 16px; }
    .card { padding: 28px 22px; }
    .logo-section h1 { font-size: 1.5rem; }
    .action-row { grid-template-columns: 1fr; }
}
