/* ==========================================================================
   Tim Humas FH UNAND — Compact Mobile-First Stylesheet
   Font: Local Nunito (400..800) | Colors: #8b0000 & #006400
   ========================================================================== */

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/nunito-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/nunito-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --maroon: #8b0000;
    --maroon-dark: #660000;
    --maroon-soft: #fdf2f2;
    --maroon-border: #e8c4c4;
    --green: #006400;
    --green-dark: #004b00;
    --green-soft: #eef8ee;
    --green-border: #bddbbc;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1c2430;
    --muted: #647082;
    --border: #dce2ea;
    --amber: #b45309;
    --amber-soft: #fef6e7;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }

.icon { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.icon-sm { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.icon-lg { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* Slim Header (Mobile-First) */
.site-header {
    background: linear-gradient(135deg, var(--maroon-dark) 0%, var(--maroon) 75%, #9e1414 100%);
    color: #fff;
    border-bottom: 3px solid var(--green);
    padding: 12px 14px;
}

.container {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 10px;
}

.brand-logo {
    grid-column: 1;
    grid-row: 1;
    height: 30px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.stage-pill {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.header-titles {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
}

.hero-title {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 800;
    line-height: 1.25;
}

.hero-sub {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.88);
}

.stage-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
}

/* Main Wrapper */
.main-wrap {
    padding: 12px 12px 32px;
}

/* Navigation Tabs (Zero Overflow on Narrow Mobile) */
.nav-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
    background: var(--surface);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 8px 6px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    text-align: center;
    line-height: 1.2;
}

.nav-tab:hover { background: #f3f4f6; color: var(--text); }
.nav-tab.active { background: var(--maroon); color: #fff; }

/* Slim Cluster Info Dropdown */
.cluster-details {
    background: var(--surface);
    border: 1px solid var(--green-border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
}

.cluster-details summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--green-dark);
    background: var(--green-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cluster-details summary::-webkit-details-marker { display: none; }
.cluster-chevron { transition: transform 0.2s ease; }
.cluster-details[open] .cluster-chevron { transform: rotate(180deg); }

.cluster-body {
    padding: 10px 12px;
    border-top: 1px solid var(--green-border);
}

.cluster-note {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: var(--text);
}

.cluster-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.cluster-box {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 7px 10px;
}

.cluster-box h4 { margin: 0 0 2px; font-size: 0.78rem; font-weight: 800; color: var(--maroon); }
.cluster-box p { margin: 0; font-size: 0.75rem; color: var(--muted); }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.card-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #edf0f4;
}

.card-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--maroon);
    display: flex;
    align-items: center;
    gap: 7px;
}

.card-subtitle {
    margin: 2px 0 10px;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 0.84rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid transparent;
}

.alert-error { background: var(--maroon-soft); border-color: var(--maroon-border); color: var(--maroon-dark); }
.alert-success { background: var(--green-soft); border-color: var(--green-border); color: var(--green-dark); }
.alert-info { background: #f0f5ff; border-color: #c7d9ff; color: #1e3a8a; }
.alert-warn { background: var(--amber-soft); border-color: #f4d39e; color: #7c2d12; }
.alert ul { margin: 4px 0 0; padding-left: 16px; }

/* Compact Form Grid & Controls */
.form-section-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--green);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    margin: 14px 0 10px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.form-grid-2.mobile-cols-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: end;
}

.form-group {
    margin-bottom: 10px;
    min-width: 0;
}

.form-grid-2 .form-group {
    margin-bottom: 0;
}

.form-grid-2.mobile-cols-2 .radio-cards {
    gap: 6px;
}

.form-grid-2.mobile-cols-2 .radio-card-box {
    padding: 8px 6px;
    font-size: 0.85rem;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-weight: 700;
    font-size: 0.83rem;
    margin-bottom: 4px;
    color: var(--text);
}

.req { color: var(--maroon); font-weight: 800; }
.opt { color: var(--muted); font-weight: 600; font-size: 0.75rem; }

.form-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 8px 11px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.9rem;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
    -webkit-appearance: none;
    appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='none' stroke='%23647082' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-control:focus {
    outline: none;
    border-color: var(--maroon);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.10);
}

.form-control.is-valid { border-color: var(--green); }
.form-control.is-invalid { border-color: #c62828; background: #fffafa; }

textarea.form-control {
    resize: vertical;
    min-height: 78px;
    line-height: 1.45;
}

.form-hint {
    margin-top: 3px;
    font-size: 0.74rem;
    color: var(--muted);
    line-height: 1.3;
}

.form-hint.valid-msg { color: var(--green); font-weight: 700; }
.form-hint.error-msg { color: #b91c1c; font-weight: 700; }

/* Input with prefix (@) */
.input-group { display: flex; align-items: stretch; }
.input-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: #f1f4f8;
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--muted);
}
.input-group .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Compact Radio Pills (Angkatan 2024 / 2025) */
.radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.radio-card-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text);
    transition: all 0.14s ease;
}

.radio-card input:checked + .radio-card-box {
    border-color: var(--maroon);
    background: var(--maroon-soft);
    color: var(--maroon-dark);
}

/* Compact Horizontal Photo Uploader */
.photo-uploader {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1.5px dashed var(--maroon-border);
    border-radius: var(--radius-sm);
    background: #fcfafb;
}

.photo-preview-box {
    width: 60px;
    height: 76px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f1f3f6;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.photo-preview-box img { width: 100%; height: 100%; object-fit: cover; }

.photo-actions {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.photo-btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-status { font-size: 0.74rem; color: var(--muted); }
.photo-status.is-ok { color: var(--green); font-weight: 700; }
.photo-status.error-msg { color: #b91c1c; font-weight: 700; }

/* Tombol Gabung Grup WhatsApp (hanya untuk peserta Lulus Administrasi) */
.btn-wa-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    background: #25d366;
    color: #fff !important;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}
.btn-wa-group:hover, .btn-wa-group:focus { background: #1ebe5a; text-decoration: none; }
.btn-wa-group .icon-sm { width: 18px; height: 18px; }

.sr-only-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Compact Portfolio Drop */
.file-drop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease;
}

.file-drop:hover { border-color: var(--maroon); background: var(--maroon-soft); }
.file-drop.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }

.file-drop-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--maroon);
    flex-shrink: 0;
}

.file-drop.has-file .file-drop-icon { color: var(--green); border-color: var(--green-border); }
.file-drop-text { flex: 1; min-width: 0; }
.file-drop-title { font-weight: 800; font-size: 0.83rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-drop-sub { font-size: 0.72rem; color: var(--muted); }

/* Cluster inline tag */
.cluster-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid var(--green-border);
}

/* Bottom Submit + Captcha Bar */
.submit-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: center;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid #edf0f4;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 7px;
}

.captcha-question {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 7px;
    background: var(--maroon);
    color: #fff;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    user-select: none;
}

.captcha-input {
    width: 82px;
    text-align: center;
    font-weight: 800;
    padding: 7px 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease;
    text-decoration: none;
    line-height: 1.2;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--maroon-dark); text-decoration: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--green-dark); text-decoration: none; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--maroon); color: var(--maroon); background: var(--maroon-soft); text-decoration: none; }
.btn-outline-green { background: #fff; border-color: var(--green-border); color: var(--green-dark); }
.btn-outline-green:hover:not(:disabled) { background: var(--green-soft); border-color: var(--green); text-decoration: none; }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; }
.btn-block { width: 100%; padding: 10px 16px; font-size: 0.92rem; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}
.badge-pending { background: var(--amber-soft); color: var(--amber); border: 1px solid #f4d39e; }
.badge-lulus { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green-border); }
.badge-gagal { background: var(--maroon-soft); color: var(--maroon-dark); border: 1px solid var(--maroon-border); }

/* Receipt */
.receipt-box {
    border: 2px solid var(--green);
    background: linear-gradient(180deg, var(--green-soft) 0%, #fff 40%);
    text-align: center;
}
.receipt-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.receipt-code {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--maroon);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    margin: 6px 0 12px;
}
.receipt-meta {
    text-align: left;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 10px 0 14px;
    font-size: 0.84rem;
}
.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px dashed #e6eaf0;
}
.receipt-row > span {
    flex-shrink: 0;
    color: var(--muted);
}
.receipt-row > strong {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.receipt-row:last-child { border-bottom: none; }

/* Status & Announcements */
.search-bar { display: flex; gap: 8px; }
.search-bar .form-control { flex: 1; }
.status-result-card {
    margin-top: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #fafbfc;
}
.announce-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.announce-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}
.announce-name { font-weight: 800; font-size: 0.88rem; }
.announce-meta { font-size: 0.76rem; color: var(--muted); }

.hidden { display: none !important; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 12px;
    font-size: 0.76rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* 2-Column Compact Breakpoint (Tablets, Landscape Mobile & Desktop) */
@media (min-width: 580px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 14px;
    }
    .brand-logo {
        grid-column: 1;
        grid-row: 1;
        height: 40px;
    }
    .header-titles {
        grid-column: 2;
        grid-row: 1;
        border-left: 1px solid rgba(255, 255, 255, 0.25);
        padding-left: 14px;
    }
    .stage-pill {
        grid-column: 3;
        grid-row: 1;
    }
    .nav-tab { font-size: 0.86rem; padding: 9px 12px; }
    .card { padding: 18px 20px; }
    .form-grid-2 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }
    .form-grid-2.mobile-cols-2 .radio-cards {
        gap: 8px;
    }
    .form-grid-2.mobile-cols-2 .radio-card-box {
        padding: 8px 10px;
        font-size: 0.88rem;
    }
    .cluster-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .submit-bar {
        grid-template-columns: auto 1fr;
        gap: 14px;
    }
}
