:root {
    /* Theme Palette: Kemenag Hijau, Putih & Kuning Keemasan */
    --kemenag-green: #006837;
    --kemenag-green-dark: #004d28;
    --kemenag-green-light: #e6f4ed;
    --kemenag-green-glow: rgba(0, 104, 55, 0.2);

    --kemenag-gold: #d97706;
    --kemenag-gold-hover: #b45309;
    --kemenag-gold-light: #fef3c7;
    --kemenag-gold-border: rgba(217, 119, 6, 0.35);

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;

    --border-light: #e2e8f0;
    --border-gold: rgba(217, 119, 6, 0.25);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-gold: #92400e;

    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 12px 32px -8px rgba(0, 104, 55, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 40px -10px rgba(0, 104, 55, 0.14);

    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Ambient Glows & Patterns */
.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #ebf7f0 0%, #f8fafc 70%);
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 104, 55, 0.12) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.12) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Top Kemenag Gold Ribbon */
.top-gold-bar {
    height: 6px;
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 50%, #d97706 100%);
    width: 100%;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 104, 55, 0.12);
    border: 1.5px solid var(--border-light);
    padding: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--kemenag-green);
    line-height: 1.15;
}

.brand-text h1 span {
    color: var(--kemenag-gold);
}

.brand-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    background: var(--kemenag-green-light);
    color: var(--kemenag-green);
    border: 1px solid rgba(0, 104, 55, 0.2);
    padding: 6px 14px;
    border-radius: 99px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--kemenag-green);
    box-shadow: 0 0 10px var(--kemenag-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Main Layout */
.main-content {
    flex: 1;
    padding-top: 40px;
    padding-bottom: 64px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Hero Section */
.text-center {
    text-align: center;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gold);
    background: var(--kemenag-gold-light);
    border: 1px solid var(--kemenag-gold-border);
    padding: 6px 18px;
    border-radius: 99px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--kemenag-green);
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.02rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-subtitle strong {
    color: var(--kemenag-green);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-top: 4px solid var(--kemenag-green);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    margin-bottom: 28px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--kemenag-green);
    margin-bottom: 6px;
}

.card-header p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* Form Styles */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

@media (max-width: 640px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge-hint {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gold);
    background: var(--kemenag-gold-light);
    border: 1px solid rgba(217, 119, 6, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

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

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-light);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 14px 16px 14px 48px;
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.25s ease;
}

.input-wrapper input:focus {
    border-color: var(--kemenag-green);
    box-shadow: 0 0 0 4px var(--kemenag-green-glow);
    background: #ffffff;
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--kemenag-green);
}

.input-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--kemenag-green), var(--kemenag-green-dark));
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(0, 104, 55, 0.3);
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 104, 55, 0.4);
    filter: brightness(1.05);
}

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

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.btn-gold {
    background: linear-gradient(135deg, var(--kemenag-gold), var(--kemenag-gold-hover));
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(217, 119, 6, 0.35);
}

.btn-gold:hover {
    box-shadow: 0 6px 22px rgba(217, 119, 6, 0.45);
    transform: translateY(-2px);
}

.btn-disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
    border: 1px solid #cbd5e1 !important;
}

.btn-icon-small {
    background: #f1f5f9;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-small:hover {
    background: var(--kemenag-gold-light);
    color: var(--kemenag-gold);
    border-color: var(--kemenag-gold-border);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Alert Boxes */
.alert {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.5;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-success {
    background: var(--kemenag-green-light);
    border: 1px solid #86efac;
    color: #065f46;
}

/* Result Card & Quota Badge */
.result-card {
    border-top: 5px solid var(--kemenag-gold);
    border-color: var(--kemenag-gold-border);
    box-shadow: 0 16px 40px -10px rgba(217, 119, 6, 0.12);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.verified-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--kemenag-green-light);
    color: var(--kemenag-green);
    border: 1px solid rgba(0, 104, 55, 0.3);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
}

.quota-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
}

.quota-full {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.quota-last {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.quota-empty {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.lecturer-name {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--kemenag-green);
}

.ptp-name {
    font-size: 0.98rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 640px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.text-mono {
    font-family: monospace;
    letter-spacing: 0.05em;
}

.nik-reveal-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* File Download Box */
.file-download-box {
    background: linear-gradient(135deg, var(--kemenag-green-light), var(--kemenag-gold-light));
    border: 1.5px solid var(--kemenag-gold-border);
    padding: 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
}

@media (max-width: 640px) {
    .file-download-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.file-info-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--kemenag-green);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 104, 55, 0.25);
}

@media (max-width: 640px) {
    .file-info-icon {
        margin: 0 auto;
    }
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--kemenag-green-dark);
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.92rem;
    font-weight: 500;
}

.warning-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-bottom: 4px solid var(--kemenag-gold);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
    .stats-bar {
        flex-direction: column;
        gap: 20px;
    }
    .stat-divider {
        display: none;
    }
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--kemenag-green);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-light);
}

/* Footer */
.app-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: 24px 0;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: auto;
}

.hidden {
    display: none !important;
}
