/*
 * HCU crest colour theme — gold header band, deep green + red accents,
 * black text, matching the School of Graduate Studies & Research crest.
 */
:root {
    --hcu-gold: #F2B705;
    --hcu-gold-dark: #B8860B;
    --hcu-green: #046A38;
    --hcu-red: #CE1126;
    --hcu-black: #1A1A1A;

    --bs-primary: var(--hcu-gold-dark);
    --bs-primary-rgb: 184, 134, 11;
    --bs-secondary: var(--hcu-green);
    --bs-secondary-rgb: 4, 106, 56;
    --bs-danger: var(--hcu-red);
    --bs-danger-rgb: 206, 17, 38;
    --bs-body-color: var(--hcu-black);
    --bs-link-color: var(--hcu-green);
    --bs-link-hover-color: var(--hcu-gold-dark);
}

body {
    background-color: #FAF7F0;
}

/*
 * Background image, scoped to .hcu-content rather than body. This element
 * exists on every page and naturally spans full width on login (no sidebar
 * sibling present there) but only the content column once the sidebar is
 * showing — so one rule gives "full page on login, content-area-only on app
 * pages" without needing two separate treatments.
 *
 * IMPORTANT: place the real crest/campus image at
 * public/images/backgrounds/hcu-background.png — until that file exists at
 * exactly that path, this has no visible effect beyond the faint gold tint
 * below (which has no dependency on the image file and always renders).
 */
.hcu-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--hcu-gold);
    background-image: url('/images/backgrounds/hcu-background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-blend-mode: multiply;
    opacity: .16;
    z-index: -1;
}

.navbar-hcu {
    background: linear-gradient(180deg, var(--hcu-gold) 0%, var(--hcu-gold-dark) 100%);
    border-bottom: 4px solid var(--hcu-green);
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.hcu-header-contact a {
    color: var(--hcu-black);
}

.hcu-header-contact a:hover {
    color: #fff;
}

/* Vertically centers the login card within the available page height —
   scoped to login templates only, not applied globally to <main>. */
.hcu-login-center {
    min-height: 65vh;
    display: flex;
    align-items: center;
}

.navbar-hcu .navbar-brand {
    color: var(--hcu-black);
    font-weight: 700;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: .6rem;
}

/* Logo was blowing out the header's height before this was constrained —
   cap it to a fixed height and let width scale proportionally. */
.navbar-hcu .navbar-brand img {
    height: auto;
    width: 100px;
    display: block;
}

.navbar-hcu .navbar-text,
.navbar-hcu a.nav-link {
    color: var(--hcu-black) !important;
}

.navbar-hcu .nav-link.active {
    font-weight: 700;
    text-decoration: underline;
}

.btn-primary {
    background-color: var(--hcu-gold-dark);
    border-color: var(--hcu-gold-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #96690a;
    border-color: #96690a;
}

.card-hcu-header {
    background-color: var(--hcu-green);
    color: #fff;
    border-radius: .375rem .375rem 0 0;
}

.step-breadcrumb .step-item {
    color: #6c757d;
}

.step-breadcrumb .step-item.current {
    color: var(--hcu-green);
    font-weight: 700;
}

.step-breadcrumb .step-sep {
    color: #ced4da;
    margin: 0 .35rem;
}

/* Wizard stepper — numbered/icon circles connected by a line, with
   completed / current / upcoming states. */
.hcu-stepper {
    display: flex;
    flex-wrap: wrap;
    row-gap: 1.5rem;
    background-color: rgba(255, 255, 255, .72);
    backdrop-filter: blur(2px);
    border-radius: .75rem;
    padding: 1.25rem 1rem;
}

.hcu-step {
    flex: 1 1 0;
    min-width: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.hcu-step:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 21px;
    right: 50%;
    width: 100%;
    height: 2px;
    background-color: #dee2e6;
    z-index: 0;
}

.hcu-step.is-complete:not(:first-child)::before {
    background-color: var(--hcu-green);
}

.hcu-step-circle {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background-color: #fff;
    border: 2px solid #dee2e6;
    color: #adb5bd;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.hcu-step.is-complete .hcu-step-circle {
    background-color: var(--hcu-green);
    border-color: var(--hcu-green);
    color: #fff;
}

.hcu-step.is-current .hcu-step-circle {
    background-color: var(--hcu-gold-dark);
    border-color: var(--hcu-gold-dark);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(184, 134, 11, .18);
}

.hcu-step-label {
    margin-top: .5rem;
    font-size: .8rem;
    line-height: 1.2;
    color: #6c757d;
}

.hcu-step.is-current .hcu-step-label {
    color: var(--hcu-green);
    font-weight: 700;
}

.hcu-step.is-complete .hcu-step-label {
    color: var(--hcu-black);
}

@media (max-width: 767.98px) {
    .hcu-stepper {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: .5rem;
    }

    .hcu-step {
        flex: 0 0 auto;
        min-width: 100px;
    }
}

footer.hcu-footer {
    color: #6c757d;
    font-size: .85rem;
}

/* ---- Sidebar layout (applicant/admin authenticated pages) ---- */

.hcu-layout {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.hcu-content {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.hcu-sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: linear-gradient(180deg, var(--hcu-gold) 0%, var(--hcu-gold-dark) 100%);
    border-right: 4px solid var(--hcu-green);
}

.hcu-layout.has-sidebar .hcu-sidebar.d-lg-flex {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.hcu-sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1rem;
    color: var(--hcu-black);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid rgba(0, 0, 0, .12);
    flex: 0 0 auto;
}

.hcu-sidebar-brand:hover {
    color: var(--hcu-black);
}

.hcu-sidebar-brand img {
    height: auto;
    width: 92px;
    display: block;
}

.hcu-sidebar-identity {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, .12);
    flex: 0 0 auto;
}

.hcu-sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, .08);
    border: 2px solid var(--hcu-gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.hcu-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hcu-sidebar-avatar i {
    font-size: 20px;
    color: var(--hcu-black);
    opacity: .5;
}

.hcu-sidebar-identity-text {
    min-width: 0;
}

.hcu-sidebar-name {
    font-size: .85rem;
    font-weight: 700;
    color: var(--hcu-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hcu-sidebar-osn {
    font-size: .72rem;
    color: var(--hcu-black);
    opacity: .65;
}

.hcu-sidebar-nav-scroll {
    overflow-y: auto;
    padding: 1rem .75rem;
}

.hcu-sidebar-footer {
    flex: 0 0 auto;
    padding: .75rem;
    border-top: 1px solid rgba(0, 0, 0, .12);
}

.hcu-sidebar-links .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--hcu-black);
    border-radius: .375rem;
    padding: .55rem .75rem;
    margin-bottom: .2rem;
    font-size: .92rem;
}

.hcu-sidebar-links .nav-link:hover {
    background-color: rgba(0, 0, 0, .07);
}

.hcu-sidebar-links .nav-link.active {
    background-color: rgba(255, 255, 255, .55);
    font-weight: 700;
}

.hcu-sidebar-links .nav-link.disabled {
    color: rgba(26, 26, 26, .55);
    cursor: not-allowed;
}

.hcu-sidebar-links .nav-link.disabled:hover {
    background-color: transparent;
}

.hcu-sidebar-chevron {
    font-size: .75rem;
    transition: transform .15s ease-in-out;
}

.hcu-sidebar-links .nav-link[aria-expanded="true"] .hcu-sidebar-chevron {
    transform: rotate(180deg);
}

.hcu-sidebar-submenu {
    padding-left: .5rem;
    margin-top: .1rem;
}

.hcu-sidebar-submenu .hcu-sidebar-sublink {
    padding: .4rem .75rem .4rem 1.6rem;
    font-size: .84rem;
}

.hcu-sidebar-subgroup-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(26, 26, 26, .55);
    padding: .5rem .75rem .15rem 1.1rem;
}

.hcu-sidebar-subgroup-label:first-child {
    padding-top: .25rem;
}

.hcu-step-check {
    margin-left: auto;
    color: var(--hcu-green);
    font-size: .85rem;
}

.hcu-step-lock {
    margin-left: auto;
    color: var(--hcu-red);
    font-size: .85rem;
}

/* Offcanvas reuses .hcu-sidebar's gold theme; only the layout differs. */
.offcanvas.hcu-sidebar {
    width: 260px;
}

/* Always-visible top header — title only, no nav links */
.hcu-topbar {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: .85rem 1.25rem;
}

.hcu-topbar-title {
    font-weight: 700;
    color: var(--hcu-green);
    font-size: 1.05rem;
}

/* ---- Personal details: photo upload frame ---- */
/* Visually hides the file input while keeping it technically "rendered" —
   display:none (Bootstrap's .d-none) can cause .click() to silently fail to
   open the native file picker in some browsers, since a display:none
   element is treated as non-interactive at the OS-dialog level regardless
   of how the click was triggered. This keeps it interactive. */
.hcu-visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hcu-photo-frame {
    position: relative;
    display: block;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f1eee6;
    border: 3px solid var(--hcu-gold-dark);
    cursor: pointer;
}

.hcu-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hcu-photo-frame #photo-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3.5rem;
    color: #c8c2b0;
}

.hcu-photo-frame-overlay {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(26, 26, 26, .55);
    color: #fff;
    text-align: center;
    padding: .3rem 0;
    font-size: .85rem;
}

/* ---- Form section headers, used to break long forms into visual groups
   without adding heavy card-in-card nesting ---- */
/* Required-field asterisk — Symfony's form theming automatically adds the
   "required" class to a field's <label> whenever that field's `required`
   option is true, so this one rule covers every form in the app without
   touching individual FormTypes. */
label.required::after,
.form-check-label.required::after {
    content: " *";
    color: var(--hcu-red);
}

/* Flatpickr's injected year <select> (see addYearDropdown in app.js) —
   sized to sit inline in the calendar header next to the month dropdown. */
.flatpickr-year-select {
    font-size: 13px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: inherit;
    padding: 0 2px;
    cursor: pointer;
}

.hcu-form-section-title {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hcu-green);
    font-weight: 700;
    border-bottom: 2px solid #eee;
    padding-bottom: .4rem;
    margin-bottom: 1rem;
}

/* Reusable soft card for grouped fields — education rows, referee blocks,
   the declaration box, etc. */
.hcu-collection-card {
    background-color: #FAF9F6;
    border: 1px solid #ece7da;
    border-radius: .5rem;
    padding: 1.25rem;
}

/* Tabulator cell that opens something on click (not an edit) — see
   admin-settings-course-curriculum.js's Code/Course columns, which open
   the "which programmes offer this course" modal. */
.hcu-clickable-cell {
    cursor: pointer;
}