/* =========================================================
   MAIN.CSS - Gaya dasar, sama untuk semua perangkat
   Aturan ukuran/layout spesifik ada di:
   desktop.css, tablet.css, mobile.css
   ========================================================= */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 10px;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { text-decoration: none; color: var(--primary); }

.container {
    width: 100%;
    margin: 0 auto;
    padding: 16px;
}

/* NAVBAR */
.navbar {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    flex-wrap: wrap;
}
.navbar .brand { font-weight: 700; font-size: 1.2rem; color: #fff; }
.navbar .nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.navbar .nav-links a { color: #fff; opacity: .9; padding: 6px 10px; border-radius: 6px; }
.navbar .nav-links a:hover { background: rgba(255,255,255,.15); opacity: 1; }
.navbar .user-info { font-size: .9rem; }

/* CARD */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 18px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

/* GRID DASHBOARD */
.grid {
    display: grid;
    gap: 16px;
}
.stat-box {
    background: var(--card-bg);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.stat-box h3 { font-size: 1.8rem; color: var(--primary-dark); }
.stat-box p { color: var(--muted); font-size: .9rem; }

/* FORM */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 90px; }

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; }

/* TABLE */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
table th, table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: .92rem;
}
table th { background: #f8fafc; font-weight: 700; color: var(--muted); }
table tr:hover { background: #f8fafc; }

/* BADGE */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ALERT */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* LOGIN PAGE */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    padding: 16px;
}
.login-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.login-box h2 { text-align: center; margin-bottom: 6px; color: var(--primary-dark); }
.login-box p.subtitle { text-align: center; color: var(--muted); margin-bottom: 20px; font-size: .9rem; }
.login-switch { text-align: center; margin-top: 14px; font-size: .88rem; }

/* TIMER UJIAN */
.exam-timer {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--danger);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* SOAL */
.soal-box { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.soal-nomor { font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.pilihan-item { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.pilihan-item:hover { background: #f0f7ff; }
.pilihan-item input { margin-right: 10px; }

/* HASIL NILAI */
.score-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 800;
    margin: 0 auto 16px auto;
}

.footer-note { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 24px; padding-bottom: 20px; }

.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
