/* FLC custom frontend styles (separate from the vendor template CSS). */

/* ---------------------------------------------------------------------------
 * Minimal Bootstrap 4/5-style utilities.
 * The template ships Bootstrap 3.3.6, which lacks the spacing/flex utility
 * scale (padding, margin, d-flex, gap, etc.).
 * These backfill the most-used ones (spacing scale: 0 .25 .5 1 1.5 3rem).
 * ------------------------------------------------------------------------- */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.w-100 { width: 100% !important; }
.text-end { text-align: right !important; }

.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: .25rem !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.flc-section {
    padding: 40px 0;
}

.flc-page-title {
    margin-bottom: 8px;
}

.flc-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flc-meta-list > li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.flc-meta-list > li:last-child {
    border-bottom: 0;
}

.flc-meta-list .flc-meta-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888;
}

.flc-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
}

.flc-student-row {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.flc-student-row .flc-req {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.flc-required-star {
    color: #d9534f;
}

/* .flc-prose list/img styles moved to brand.css (loaded globally) so the
   homepage and other pages that don't include custom.css render WYSIWYG
   rich text consistently. */

.flc-submit-bar {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(15, 35, 60, 0.12);
    backdrop-filter: blur(8px);
}

.flc-submit-bar > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.flc-submit-bar strong {
    color: #183b67;
}

@media (min-width: 768px) {
    .flc-submit-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* ==========================================================================
   Repeatable student registration form (+ Daftarkan Siswa → picker modal)
   ========================================================================== */

.flc-field-error {
    margin: 8px 0 0;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.flc-picker-intro {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #cfe0f3;
    border-radius: 10px;
    background: #f5f9ff;
}

.flc-picker-intro h4 {
    margin: 0 0 4px;
    color: #183b67;
    font-size: 16px;
    font-weight: 800;
}

.flc-picker-intro p {
    margin: 0;
}

.flc-selection-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.flc-selection-toolbar > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.flc-selection-toolbar strong {
    color: #183b67;
}

.flc-clear-students,
.flc-picker-clear {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.flc-clear-students:hover,
.flc-clear-students:focus-visible,
.flc-picker-clear:hover,
.flc-picker-clear:focus-visible {
    color: #7f1d1d;
    text-decoration: underline;
}

.flc-picker-clear:disabled {
    color: #9ca3af;
    cursor: not-allowed;
    text-decoration: none;
}

@media (min-width: 768px) {
    .flc-picker-intro,
    .flc-selection-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.flc-empty-hint {
    margin: 0;
    padding: 22px 16px;
    border: 1px dashed #d5dbe3;
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
}

.flc-student-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flc-student-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.flc-student-block.is-incomplete {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.flc-student-block.is-incomplete .flc-student-head {
    background: #fffbeb;
}

.flc-student-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fbfcfe;
    cursor: pointer;
    list-style: none;
}

.flc-student-head::-webkit-details-marker {
    display: none;
}

.flc-student-head:focus-visible {
    outline: 3px solid rgba(27, 108, 174, 0.28);
    outline-offset: -3px;
}

.flc-student-summary-main {
    display: flex;
    min-width: 0;
    flex: 1 1 220px;
    align-items: center;
    gap: 12px;
}

.flc-student-number {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #183b67;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.flc-student-ident {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.flc-student-ident strong {
    color: #1f2937;
}

.flc-student-head-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.flc-requirement-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.flc-requirement-status.is-incomplete {
    background: #fef3c7;
    color: #92400e;
}

.flc-requirement-status.is-complete {
    background: #dcfce7;
    color: #166534;
}

.flc-student-toggle {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    color: #1b6cae;
    font-size: 12px;
    font-weight: 700;
}

.flc-student-toggle i {
    transition: transform 0.2s ease;
}

.flc-student-block[open] .flc-student-toggle i {
    transform: rotate(180deg);
}

@media (max-width: 575px) {
    .flc-student-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .flc-student-head-state {
        width: 100%;
        justify-content: space-between;
        padding-left: 44px;
    }
}

.flc-student-body {
    padding: 16px;
    border-top: 1px solid #eef1f5;
}

.flc-student-actions {
    display: flex;
    justify-content: flex-end;
}

.flc-remove-student {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid #e3b5b5;
    border-radius: 6px;
    background: #fff;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.flc-remove-student:hover,
.flc-remove-student:focus {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.flc-student-block .flc-req {
    margin-top: 4px;
}

.flc-student-requirement-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #d9dee7;
}

.flc-student-requirement-heading strong {
    color: #183b67;
}

.flc-master-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.flc-master-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0 8px;
    padding: 8px 10px;
    border: 1px solid #dbeafe;
    border-radius: 7px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
}

.flc-master-state[hidden] {
    display: none;
}

.flc-master-state.is-complete {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.flc-master-state.is-expired,
.flc-master-state.is-missing {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.flc-master-state a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
}

/* --- Picker modal --------------------------------------------------------- */
.flc-modal[hidden] {
    display: none;
}

.flc-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.flc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 20, 40, 0.55);
}

.flc-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    background: #fff;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}

.flc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.flc-modal__head h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.flc-modal__close {
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.flc-modal__close:hover,
.flc-modal__close:focus {
    color: #111827;
}

.flc-modal__body {
    padding: 16px 18px 20px;
    overflow-y: auto;
}

.flc-picker-filters {
    display: grid;
    gap: 10px;
}

.flc-picker-search {
    position: relative;
}

.flc-picker-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: #6b7280;
    transform: translateY(-50%);
}

.flc-picker-search .form-control {
    padding-left: 36px;
}

.flc-picker-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.flc-picker-actions strong {
    color: #183b67;
    font-size: 13px;
    font-weight: 800;
}

.flc-picker-table input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #1b6cae;
}

.flc-picker-feedback {
    min-height: 20px;
    margin: 10px 0 0;
    font-size: 12px;
}

.flc-picker-table-wrap {
    max-height: 44vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.flc-picker-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: #fff;
    text-align: left;
}

.flc-picker-table th,
.flc-picker-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: middle;
}

.flc-picker-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f9fc;
    color: #374151;
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.flc-picker-table tbody tr:last-child td {
    border-bottom: 0;
}

.flc-picker-table tbody tr:hover,
.flc-picker-table tbody tr:focus-within {
    background: #f7fbff;
}

.flc-picker-table tbody tr.is-selected {
    background: #eef6ff;
}

.flc-picker-table tbody tr.is-added {
    color: #6b7280;
    background: #f9fafb;
}

.flc-picker-table__check {
    width: 48px;
    text-align: center;
}

.flc-picker-added {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 400;
}

.flc-picker-empty {
    margin: 0;
    padding: 18px 14px;
    text-align: center;
}

.flc-picker-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.flc-picker-pagination[hidden] {
    display: none;
}

.flc-picker-pagination span {
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.flc-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

body.flc-modal-open {
    overflow: hidden;
}

/* Desktop: centre the picker as a regular dialog. */
@media (min-width: 768px) {
    .flc-modal {
        align-items: center;
    }

    .flc-modal__panel {
        max-width: 720px;
        border-radius: 12px;
    }

    .flc-picker-filters {
        grid-template-columns: minmax(0, 1fr) 190px;
    }
}
