/* ===================================================
   KEMAHASISWAAN UBHINUS — PENGGUNA LULUSAN SURVEY
   =================================================== */

:root {
    --primary:       #1A237E;
    --primary-light: #3949AB;
    --primary-dark:  #0D1457;
    --success:       #2E7D32;
    --success-light: #E8F5E9;
    --danger:        #D32F2F;
    --white:         #FFFFFF;
    --off-white:     #F5F7FF;
    --bg:            #EEF0FA;
    --text:          #1A1A2E;
    --text-muted:    #6B7280;
    --border:        #E0E4F0;
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --shadow-sm:     0 2px 8px rgba(26,35,126,0.08);
    --shadow-md:     0 6px 24px rgba(26,35,126,0.12);
    --header-h:      68px;
    --transition:    0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   HEADER
   ============================================================ */
.pg-header {
    height: var(--header-h);
    background: var(--primary-dark);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.pg-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.pg-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.pg-brand img { width: 38px; height: 38px; object-fit: contain; }
.pg-brand-main { display: block; font-size: 0.9rem; font-weight: 700; color: white; line-height: 1.2; }
.pg-brand-sub  { display: block; font-size: 0.7rem; color: rgba(255,255,255,0.5); }
.pg-back-link {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.7);
    padding: 6px 12px; border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.pg-back-link:hover { background: rgba(255,255,255,0.1); color: white; }

/* ============================================================
   WRAPPER & LAYOUT
   ============================================================ */
.pg-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--header-h) + 32px) 24px 56px;
}

/* ============================================================
   INTRO BANNER
   ============================================================ */
.pg-intro {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #5C6BC0 100%);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    color: white;
    text-align: center;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
}
.pg-intro-icon {
    width: 72px; height: 72px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin: 0 auto 18px;
    backdrop-filter: blur(4px);
}
.pg-intro h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }
.pg-intro p  { font-size: 0.92rem; opacity: 0.88; max-width: 600px; margin: 0 auto 18px; line-height: 1.7; }
.pg-intro-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 0.82rem;
}
.pg-intro-meta span {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.12);
    padding: 5px 14px;
    border-radius: 99px;
}

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.pg-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.pg-section-hdr {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.pg-badge {
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 99px;
    margin-bottom: 8px;
}
.pg-section-hdr h2 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.pg-section-hdr p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.pg-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.pg-field { display: flex; flex-direction: column; gap: 6px; }
.pg-field-full { grid-column: 1/-1; margin-bottom: 14px; }
.pg-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}
.pg-field .req { color: var(--danger); }
.pg-field input[type="text"],
.pg-field input[type="email"],
.pg-field input[type="tel"],
.pg-field select,
.pg-field textarea {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--off-white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.pg-field input:focus,
.pg-field select:focus,
.pg-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.09);
    background: white;
}
.pg-field.error input,
.pg-field.error select {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(211,47,47,0.08);
}
.field-error {
    font-size: 0.75rem; color: var(--danger);
    display: flex; align-items: center; gap: 4px; margin-top: 2px;
}
.pg-field textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   COMPETENCY SCALE LEGEND
   ============================================================ */
.pg-scale-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--off-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.pg-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 160px;
}
.pg-legend-item div { display: flex; flex-direction: column; }
.pg-legend-item strong { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.pg-legend-item small  { font-size: 0.72rem; color: var(--text-muted); }
.pg-scale-badge {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800; color: white; flex-shrink: 0;
}
.pg-sb .pg-scale-badge { background: #2E7D32; }
.pg-b  .pg-scale-badge { background: #1565C0; }
.pg-c  .pg-scale-badge { background: #E65100; }
.pg-k  .pg-scale-badge { background: var(--danger); }

/* ============================================================
   COMPETENCY RATING CARDS
   ============================================================ */
.pg-comp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.pg-comp-card {
    display: flex;
    gap: 14px;
    background: var(--off-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.pg-comp-card:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.pg-comp-card.error { border-color: var(--danger); }
.pg-comp-card-full { grid-column: 1/-1; }
.pg-comp-num {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 800; font-size: 0.85rem;
    flex-shrink: 0;
}
.pg-comp-body { flex: 1; min-width: 0; }
.pg-comp-title {
    font-size: 0.88rem; font-weight: 700; color: var(--text);
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 7px;
}
.pg-comp-title i { color: var(--primary-light); font-size: 0.85rem; }
.pg-comp-desc { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

/* Rating row buttons */
.pg-rating-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-rating-opt { cursor: pointer; }
.pg-rating-opt input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.pg-rating-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 800;
    border: 2px solid transparent;
    background: white;
    color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
    min-width: 56px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.pg-rating-label small { font-size: 0.6rem; font-weight: 500; white-space: nowrap; }
.pg-rating-opt input:checked + .pg-rating-label.sb { background: #2E7D32; border-color: #2E7D32; color: white; }
.pg-rating-opt input:checked + .pg-rating-label.b  { background: #1565C0; border-color: #1565C0; color: white; }
.pg-rating-opt input:checked + .pg-rating-label.c  { background: #E65100; border-color: #E65100; color: white; }
.pg-rating-opt input:checked + .pg-rating-label.k  { background: var(--danger); border-color: var(--danger); color: white; }
.pg-rating-label.sb:hover { border-color: #2E7D32; color: #2E7D32; }
.pg-rating-label.b:hover  { border-color: #1565C0; color: #1565C0; }
.pg-rating-label.c:hover  { border-color: #E65100; color: #E65100; }
.pg-rating-label.k:hover  { border-color: var(--danger); color: var(--danger); }

/* ============================================================
   RADIO PILLS
   ============================================================ */
.pg-radio-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pg-radio-pill {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 18px;
    background: var(--off-white);
    border: 2px solid var(--border);
    border-radius: 99px;
    font-size: 0.85rem; font-weight: 500; color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}
.pg-radio-pill input { display: none; }
.pg-radio-pill:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.pg-radio-pill:hover { border-color: var(--primary); color: var(--primary); }
.pg-radio-pill:has(input:checked):hover { background: var(--primary-light); }

/* ============================================================
   DISCLAIMER
   ============================================================ */
.pg-disclaimer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 16px;
}
.pg-disclaimer i { color: var(--primary-light); flex-shrink: 0; margin-top: 1px; font-size: 0.9rem; }

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.pg-actions {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 8px;
}
.btn-pg-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 6px 20px rgba(26,35,126,0.3);
    font-family: inherit;
}
.btn-pg-submit:hover {
    background: linear-gradient(135deg, var(--primary-light), #7986CB);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(26,35,126,0.35);
}
.btn-pg-submit:active { transform: translateY(0); }

/* ============================================================
   SUCCESS STATE
   ============================================================ */
.pg-success {
    text-align: center;
    padding: 64px 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 24px;
}
.pg-success-icon {
    width: 100px; height: 100px;
    background: linear-gradient(135deg, #2E7D32, #43A047);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    font-size: 3rem;
    color: white;
    box-shadow: 0 12px 32px rgba(46,125,50,0.3);
}
.pg-success h2 { font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.pg-success p  { font-size: 0.95rem; color: var(--text-muted); max-width: 480px; margin: 0 auto 24px; line-height: 1.7; }
.pg-success-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.pg-success-badges span {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: var(--success);
    background: var(--success-light);
    padding: 8px 18px;
    border-radius: 99px;
    font-weight: 500;
}
.btn-pg-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background var(--transition);
}
.btn-pg-home:hover { background: var(--primary-light); }

/* ============================================================
   FOOTER
   ============================================================ */
.pg-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
#pgToast {
    position: fixed; bottom: 24px; right: 24px;
    background: #1E1E2E; color: white;
    padding: 12px 20px; border-radius: var(--radius-md);
    font-size: 0.875rem; font-weight: 500;
    display: none; align-items: center; gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2); z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 320px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
#pgToast.toast-error .toast-icon { color: #FF5252; }
#pgToast.toast-success .toast-icon { color: #69F0AE; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .pg-wrapper { padding: calc(var(--header-h) + 20px) 16px 48px; }
    .pg-section { padding: 20px 16px; }
    .pg-grid-2 { grid-template-columns: 1fr; }
    .pg-comp-grid { grid-template-columns: 1fr; }
    .pg-comp-card-full { grid-column: 1; }
    .pg-intro { padding: 28px 20px; }
    .pg-intro h1 { font-size: 1.25rem; }
    .pg-scale-legend { flex-direction: column; }
    .pg-rating-row { gap: 6px; }
    .pg-rating-label { min-width: 48px; padding: 7px 10px; }
    .btn-pg-submit { padding: 12px 28px; font-size: 0.9rem; }
    .pg-success { padding: 40px 16px; }
    .pg-success h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .pg-header-inner { padding: 0 12px; }
    .pg-brand-main { font-size: 0.8rem; }
    .pg-brand-sub { display: none; }
    .pg-intro-meta { gap: 8px 12px; font-size: 0.75rem; }
}
