/* ==========================================================================
   Minimal Bootstrap-like utilities (needed by standalone widget)
   The public admission form gets these from include/head.php + Bootstrap.
   ========================================================================== */

/* ---- Grid ---- */
.row { display: flex; flex-wrap: wrap; margin-right: -5px; margin-left: -5px; }
.col-md-6, .col-md-4, .col-md-12 { position: relative; width: 100%; padding-right: 5px; padding-left: 5px; box-sizing: border-box; }
@media (min-width: 768px) {
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.33333%; max-width: 33.33333%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* ---- Buttons ---- */
.btn {
    display: inline-block; font-weight: 400; color: #212529; text-align: center;
    vertical-align: middle; cursor: pointer; user-select: none;
    background-color: transparent; border: 1px solid transparent;
    padding: .375rem .75rem; font-size: 1rem; line-height: 1.5; border-radius: .25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.btn-secondary { color: #fff; background-color: #6c757d; border-color: #6c757d; }
.btn-success { color: #fff; background-color: #28a745; border-color: #28a745; }
.btn-info { color: #fff; background-color: #17a2b8; border-color: #17a2b8; }
.btn-danger { color: #fff; background-color: #dc3545; border-color: #dc3545; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; line-height: 1.5; border-radius: .2rem; }
.btn:disabled { opacity: .65; }
.btn-outline-primary { color: var(--admission-primary); border-color: var(--admission-primary); background: transparent; }
.btn-outline-primary:hover { color: #fff; background-color: var(--admission-primary); }

/* ---- Form control base ---- */
.form-control {
    display: block; width: 100%; padding: .375rem .75rem; font-size: 1rem;
    line-height: 1.5; color: #495057; background-color: #fff;
    background-clip: padding-box; border: 1px solid #ced4da; border-radius: .25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    box-sizing: border-box;
}
select.form-control[multiple] { height: auto; }

/* ---- Form check (radio/checkbox) ---- */
.form-check { position: relative; display: block; padding-left: 1.25rem; }
.form-check-input { position: absolute; margin-top: .3rem; margin-left: -1.25rem; }
.form-check-label { margin-bottom: 0; }
.form-check-inline { display: inline-flex; align-items: center; padding-left: 0; margin-right: .75rem; }
.form-check-inline .form-check-input { position: static; margin-top: 0; margin-right: .3125rem; margin-left: 0; }

/* ---- Spacing utilities ---- */
.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-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.mr-1 { margin-right: .25rem !important; }
.p-3 { padding: 1rem !important; }

/* ---- Text utilities ---- */
.text-muted { color: #6c757d !important; }
.text-center { text-align: center !important; }
.text-danger { color: #dc3545 !important; }
.fw-normal { font-weight: 400 !important; }

/* ---- Flex utilities ---- */
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.d-flex { display: flex !important; }
.align-items-start { align-items: flex-start !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.position-relative { position: relative !important; }

/* ---- Font Awesome icon placeholders (widget loads FA 6 via CDN) ---- */
.fa { display: inline-block; font-style: normal; font-variant: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; }

/* ==========================================================================
   Admission Form Styles
   Shared by admission.php and widget/admission.php
   
   Requires the caller to set: --admission-primary (color)
   Versioned via filemtime in the PHP includes.
   ========================================================================== */

.registration-section {
    padding: 60px 20px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}
.registration-section h1 {
    font-size: clamp(2em, 4vw, 3em);
    font-weight: 700;
    text-align: center;
    color: #2e2e2e;
    margin-bottom: 30px;
}

.form-section { display: none; }
.form-section.current { display: block; }

.form-label { display: block; font-weight: bold; margin-bottom: .5rem; }
.form-control { margin-bottom: 5px; }
.form-group { margin-bottom: 1rem; }

.form-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}
.form-buttons .btn { margin: 5px; min-width: 100px; }

/* ---- Progress Indicator ---- */
.admission-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    width: 100%;
}
.admission-progress-steps {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    justify-content: space-between;
}
.admission-progress-step {
    width: 30px; height: 30px;
    background-color: #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    position: relative;
    z-index: 1;
    transition: background-color .3s ease;
}
.admission-progress-step.active { background-color: var(--admission-primary); }

.admission-progress-line {
    height: 4px;
    background-color: #e0e0e0;
    position: absolute;
    top: 50%; left: 0; right: 0;
    transform: translateY(-50%);
    z-index: 0;
    width: 100%;
    transition: background-color .3s ease;
}
.admission-progress-steps::before {
    content: '';
    position: absolute;
    top: 50%; left: 15px; right: 15px;
    height: 4px;
    background-color: #e0e0e0;
    transform: translateY(-50%);
    z-index: 0;
}
.admission-progress-steps .admission-progress-line-segment {
    position: absolute;
    top: 50%;
    height: 4px;
    background-color: var(--admission-primary);
    transform: translateY(-50%);
    z-index: 0;
    transition: width .4s ease-out;
    width: 0%;
}

/* ---- Day/Time Groups ---- */
.day-time-group {
    display: flex; flex-wrap: wrap; align-items: center;
    margin-bottom: 10px;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
}
.day-time-group label.day-label { width: 100px; margin-right: 10px; font-weight: bold; }
.day-time-group input[type=checkbox] { margin-right: 15px; }
.from-to { display: flex; align-items: center; margin-right: 10px; margin-top: 5px; }
.from-to label { font-weight: normal; margin-right: 5px; width: auto; }
.from-to input[type=time] { padding: .375rem .75rem; border: 1px solid #ced4da; border-radius: .25rem; }
.from-to input[type=time]:disabled { background-color: #e9ecef; cursor: not-allowed; }

/* ---- Validation ---- */
.is-invalid { border-color: #dc3545 !important; }
input.is-invalid, select.is-invalid, textarea.is-invalid { padding-right: calc(1.5em + .75rem); }
.invalid-feedback { display: none; width: 100%; margin-top: .25rem; font-size: .875em; color: #dc3545; }
.is-invalid ~ .invalid-feedback,
.is-invalid + .invalid-feedback,
.was-validated :invalid ~ .invalid-feedback { display: block; }

/* ---- Cards ---- */
.card { margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,.1); }
.card-body { padding: 2rem; }
h2, h5 { margin-bottom: 1.5rem; }

/* ---- Review ---- */
#reviewInfo .card { background-color: #f8f9fa; }
#reviewInfo .card-title {
    color: var(--admission-primary);
    border-bottom: 1px solid #ddd;
    padding-bottom: .5rem;
}
#reviewInfo p { margin-bottom: .5rem; }
#reviewInfo strong { display: inline-block; min-width: 120px; }

/* ---- Student List ---- */
#studentListContainer .card {
    background-color: #fdfdfd;
    border: 1px solid #d8dee8;
    border-radius: 10px;
}
.student-block-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 0.85rem; margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.student-block-title {
    margin: 0; font-size: 0.82rem; font-weight: 800;
    letter-spacing: 0.07em; text-transform: uppercase; color: #334155;
}
.student-block-remove-btn {
    background: none; border: 1px solid #fca5a5; color: #dc2626;
    border-radius: 6px; padding: 0.2rem 0.6rem;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.student-block-remove-btn:hover { background: #fef2f2; }
.remove-additional-contact { background: none; border: 1px solid #fca5a5; color: #dc2626; border-radius: 6px; padding: 0.2rem 0.6rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; text-decoration: none; }
.remove-additional-contact:hover { background: #fef2f2; }
.student-profile-section-label {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem;
}
.student-profile-section-label h6 {
    margin: 0; font-size: 0.8rem; font-weight: 800;
    letter-spacing: 0.06em; text-transform: uppercase; color: #475569;
}
.student-profile-section-label a {
    font-size: 0.82rem; color: #6366f1; font-weight: 600; text-decoration: none;
}
.student-profile-section-label a:hover { text-decoration: underline; }

.add-student-action-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0; }
.add-student-action-bar .form-control { flex: 1 1 220px; min-width: 0; }
.add-student-or-divider { font-size: 0.82rem; color: #94a3b8; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.add-student-action-bar .btn-add-new { flex-shrink: 0; white-space: nowrap; }

/* ---- Existing Profile Cards ---- */
.existing-profile-card {
    border: 1px solid #d8dee8; background: #f8fafc;
    border-radius: 8px; padding: 1rem; margin-bottom: 1.25rem;
}
.existing-profile-card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem; margin-bottom: 0.9rem;
}
.existing-profile-title { margin: 0; color: #334155; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.existing-profile-note { color: #64748b; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.existing-profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem 1.25rem; }
.existing-profile-item.profile-address { grid-column: span 2; }
.existing-profile-label { display: block; color: #64748b; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 0.18rem; text-transform: uppercase; }
.existing-profile-value { color: #475569; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.existing-client-block .custom-per-client-container,
.existing-client-block .student-enrollment-info-field { border-top: 1px solid #e5e7eb; padding-top: 1rem; margin-top: 0.75rem; }
.student-admission-heading { color: #334155; font-size: 0.88rem; font-weight: 800; letter-spacing: 0.06em; margin: 0.5rem 0 0.85rem; text-transform: uppercase; }

@media (max-width: 767.98px) {
    .existing-profile-card-header { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
    .existing-profile-grid { grid-template-columns: 1fr; }
    .existing-profile-item.profile-address { grid-column: span 1; }
}

/* ---- reCAPTCHA ---- */
.g-recaptcha { display: flex; justify-content: center; margin-top: 20px; }

/* ---- Alerts ---- */
.alert { padding: 1rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .25rem; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }

/* ---- Spinner ---- */
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .2em; }
.spinner-border {
    display: inline-block; width: 2rem; height: 2rem; vertical-align: -.125em;
    border: .25em solid currentColor; border-right-color: transparent;
    border-radius: 50%;
    -webkit-animation: .75s linear infinite spinner-border;
    animation: .75s linear infinite spinner-border;
}
@keyframes spinner-border { to { transform: rotate(360deg); } }

/* ---- Disclaimers ---- */
.disclaimer-section { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #eee; }
.disclaimer-section p { margin-bottom: 0.5rem; font-size: 0.95em; }
.disclaimer-list { list-style: none; padding-left: 0; margin-bottom: 1rem; }
.disclaimer-list li { margin-bottom: 0.3rem; }
.disclaimer-list a { text-decoration: underline; color: #0056b3; }
.disclaimer-list a i { margin-right: 5px; color: #6c757d; }

/* ==========================================================================
   Schedule Selection Styles
   ========================================================================== */
#termScheduleContainer {
    min-height: 80px; max-height: 420px; overflow-y: auto; padding-right: 0.5rem;
}
.schedule-selection-shell { display: flex; flex-direction: column; gap: 1rem; }
.schedule-selection-toolbar {
    display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end;
    padding: 0.85rem 1rem; border: 1px solid #dbe7f3; border-radius: 14px;
    background: linear-gradient(180deg, #f7fbff 0%, #f0f7ff 100%);
}
.schedule-filter-group { display: flex; flex-direction: column; gap: 0.25rem; min-width: 180px; flex: 1 1 180px; }
.schedule-filter-group label { margin: 0; font-size: 0.78rem; font-weight: 600; color: #4b5563; }
.schedule-filter-group select { font-size: 0.95rem; }
.schedule-filter-reset {
    border: 0; background: transparent; color: var(--admission-primary);
    font-weight: 600; padding: 0.5rem 0; align-self: center;
}
.schedule-section { display: flex; flex-direction: column; gap: 0.85rem; }
.schedule-section-title { margin: 0; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280; }
.schedule-summary-list, .schedule-chip-groups { display: flex; flex-direction: column; gap: 0.75rem; }

.schedule-summary-card {
    border: 1px solid #dfe6ee; border-radius: 16px; background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.schedule-summary-card.is-selected {
    border-color: var(--admission-primary);
    box-shadow: 0 10px 28px rgba(92, 70, 255, 0.12);
}
.schedule-summary-card.is-disabled { opacity: 0.6; }
.schedule-summary-head { display: flex; gap: 0.75rem; justify-content: space-between; align-items: flex-start; }
.schedule-summary-select { flex: 1 1 auto; display: flex; gap: 0.85rem; align-items: flex-start; cursor: pointer; margin: 0; }
.schedule-control-indicator {
    width: 22px; height: 22px; flex: 0 0 22px;
    border: 2px solid #c8d2de; border-radius: 999px;
    margin-top: 0.15rem; position: relative; background: #fff;
}
input[type="checkbox"].schedule-option-input + .schedule-summary-select .schedule-control-indicator { border-radius: 7px; }
.schedule-option-input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-option-input:checked + .schedule-summary-select .schedule-control-indicator {
    border-color: var(--admission-primary);
    background: var(--admission-primary);
}
.schedule-option-input:checked + .schedule-summary-select .schedule-control-indicator::after {
    content: ""; position: absolute; inset: 5px; background: #fff; border-radius: inherit;
}
input[type="checkbox"].schedule-option-input:checked + .schedule-summary-select .schedule-control-indicator::after {
    inset: 4px; border-radius: 4px;
}
.schedule-summary-content { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.schedule-summary-title { font-weight: 700; font-size: 1rem; color: #1f2937; line-height: 1.2; }
.schedule-summary-meta, .schedule-summary-submeta { color: #5b6472; font-size: 0.93rem; line-height: 1.45; }
.schedule-summary-footer {
    display: flex; justify-content: space-between; align-items: center;
    gap: 0.75rem; margin-top: 0.85rem; padding-top: 0.8rem; border-top: 1px solid #eef2f7;
}
.schedule-summary-stat { font-size: 0.82rem; font-weight: 600; color: #667085; }
.schedule-details-toggle { border: 0; background: transparent; color: var(--admission-primary); font-weight: 600; font-size: 0.88rem; padding: 0; }
.schedule-details-panel {
    margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed #d9e2ec;
    display: flex; flex-direction: column; gap: 0.45rem;
}
.schedule-detail-row { font-size: 0.88rem; color: #4b5563; }

.schedule-chip-group { border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; padding: 0.95rem 1rem; }
.schedule-chip-group-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.8rem; }
.schedule-chip-group-title { margin: 0; font-size: 1rem; font-weight: 700; color: #1f2937; }
.schedule-chip-group-subtitle { color: #6b7280; font-size: 0.85rem; white-space: nowrap; }
.schedule-chip-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.schedule-chip { position: relative; }
.schedule-chip-label {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 106px; padding: 0.7rem 0.9rem; border-radius: 999px;
    border: 1px solid #cfd8e3; background: #fff; color: #1f2937;
    font-weight: 600; font-size: 0.92rem; cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.schedule-chip-label:hover { transform: translateY(-1px); border-color: var(--admission-primary); }
.schedule-chip .schedule-option-input:checked + .schedule-chip-label {
    border-color: var(--admission-primary);
    background: rgba(92, 70, 255, 0.08);
    color: var(--admission-primary);
}
.schedule-chip.is-disabled .schedule-chip-label { opacity: 0.55; cursor: not-allowed; }
.schedule-empty-state { padding: 1rem; border: 1px dashed #d6dde6; border-radius: 14px; text-align: center; color: #6b7280; background: #fff; }

.schedule-capacity-indicator {
    display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600;
    line-height: 1.2; padding: 0.2rem 0.6rem; border-radius: 999px;
    margin-top: 0.1rem; background-color: #e9edf5; color: #1f2937; letter-spacing: 0.01em;
}
.schedule-capacity-indicator.capacity-open { background-color: #e8f1ff; color: #0f4c81; }
.schedule-capacity-indicator.capacity-available { background-color: #e6f4ea; color: #1f5c2e; }
.schedule-capacity-indicator.capacity-low { background-color: #fff4e5; color: #9c4a00; }
.schedule-capacity-indicator.capacity-full { background-color: #fdecea; color: #a11a2b; }

@media (max-width: 767.98px) {
    .schedule-summary-head, .schedule-summary-footer, .schedule-chip-group-header {
        flex-direction: column; align-items: flex-start;
    }
    .schedule-filter-group { min-width: 100%; }
    .schedule-chip-label { min-width: calc(50% - 0.6rem); }
}
