/* PAPAUSA Students Form: theme on top of Bootstrap 5 (no inline styles anywhere: strict CSP) */

:root {
    --app-navy: #0b2545;
    --app-navy-2: #13315c;
    --app-blue: #1f4e9c;
    --app-red: #b22234;
    --app-bg: #f3f5f9;
    --app-border: #dde3ec;
    --app-text: #1d2733;

    --bs-primary: #1f4e9c;
    --bs-primary-rgb: 31, 78, 156;
    --bs-link-color: #1f4e9c;
    --bs-link-color-rgb: 31, 78, 156;
    --bs-link-hover-color: #163a75;
    --bs-link-hover-color-rgb: 22, 58, 117;
    --bs-body-color: var(--app-text);
    --bs-focus-ring-color: rgba(31, 78, 156, .25);
}

/* Bootstrap 5.3 hard-codes button colors per class, so retheme them here. */
.btn-primary {
    --bs-btn-bg: #1f4e9c; --bs-btn-border-color: #1f4e9c;
    --bs-btn-hover-bg: #173d7c; --bs-btn-hover-border-color: #173d7c;
    --bs-btn-active-bg: #123166; --bs-btn-active-border-color: #123166;
    --bs-btn-disabled-bg: #1f4e9c; --bs-btn-disabled-border-color: #1f4e9c;
    --bs-btn-focus-shadow-rgb: 31, 78, 156;
}
.btn-outline-primary {
    --bs-btn-color: #1f4e9c; --bs-btn-border-color: #1f4e9c;
    --bs-btn-hover-bg: #1f4e9c; --bs-btn-hover-border-color: #1f4e9c;
    --bs-btn-active-bg: #173d7c; --bs-btn-active-border-color: #173d7c;
    --bs-btn-focus-shadow-rgb: 31, 78, 156;
}
.form-control:focus, .form-select:focus { border-color: #5b84c4; box-shadow: 0 0 0 .2rem rgba(31, 78, 156, .2); }

body { background: var(--app-bg); font-size: .975rem; }

/* ------------------------------------------------------------------ brand */
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand:hover { color: #fff; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: .5rem;
    background: #fff; color: var(--app-navy); font-size: .9rem; font-weight: 800;
    border-bottom: 3px solid var(--app-red);
}
.brand-text { font-size: 1.15rem; line-height: 1.1; }
.brand-text small { display: block; margin-top: .15rem; font-size: .7rem; font-weight: 500; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }

/* ----------------------------------------------------------- public pages */
.site-header { background: var(--app-navy); border-bottom: 4px solid var(--app-red); padding: .8rem 0; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; }
.site-header-note { color: rgba(255, 255, 255, .7); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }

.public-main { max-width: 820px; padding-top: 2rem; padding-bottom: 3rem; }
.form-intro { margin-bottom: 1.5rem; }
.form-intro h1 { font-size: 1.75rem; font-weight: 700; color: var(--app-navy); margin-bottom: .35rem; }
.form-intro .lead { font-size: 1rem; color: #5b6675; }

.card { border: 1px solid var(--app-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.form-section { margin-bottom: 1.25rem; }
.form-section .card-header { background: #fff; border-bottom: 1px solid var(--app-border); border-radius: .75rem .75rem 0 0; padding: .9rem 1.25rem; display: flex; align-items: center; gap: .75rem; }
.form-section .card-header h2 { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--app-navy); }
.form-section .card-body { padding: 1.35rem 1.25rem 1.5rem; }
.step {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: var(--app-navy); color: #fff; font-size: .85rem; font-weight: 700;
}
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-control, .form-select { padding: .6rem .8rem; border-color: #c9d2de; }
.form-text { color: #6b7686; }
/* ZIP helper message under the address row: takes no space while empty */
.row > .zip-hint { margin-top: 0; font-size: .875rem; line-height: 1.4; }
.row > .zip-hint:not(:empty) { margin-top: .25rem; }

.form-actions { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; margin-top: 1.5rem; }
.form-actions .btn-lg { padding: .75rem 2rem; font-size: 1.05rem; font-weight: 600; min-width: 14rem; }
.form-actions .btn-lg .spinner-border { margin-right: .5rem; }

/* University autocomplete */
.autocomplete { position: relative; }
.autocomplete-list {
    position: absolute; z-index: 1050; top: 100%; left: 0; right: 0; margin-top: .25rem;
    max-height: 17rem; overflow-y: auto;
    border-radius: .5rem; box-shadow: 0 8px 24px rgba(16, 24, 40, .16);
}
.autocomplete-list .list-group-item { cursor: pointer; padding: .6rem .85rem; }
.autocomplete-list .list-group-item.active { background: var(--app-blue); border-color: var(--app-blue); color: #fff; }

/* Success page */
.success-card { margin-top: 1rem; }
.success-icon {
    width: 4rem; height: 4rem; margin: 0 auto 1.25rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #e7f6ec; color: #198754; font-size: 2rem; font-weight: 700;
}
.reference-box { background: #f6f8fc; border: 1px dashed #aebbd0; border-radius: .75rem; padding: 1.1rem 1rem; }
.reference-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #5b6675; margin-bottom: .25rem; }
.reference-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; color: var(--app-navy); word-break: break-all; }

.prose h2 { margin-top: 1.5rem; color: var(--app-navy); }
.prose li { margin-bottom: .35rem; }

.site-footer { border-top: 1px solid var(--app-border); background: #fff; padding: 1rem 0; color: #6b7686; font-size: .875rem; }

/* ------------------------------------------------------------------ admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-content { padding: 1.5rem; flex: 1 1 auto; }
.admin-topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: #fff; border-bottom: 1px solid var(--app-border); position: sticky; top: 0; z-index: 1020; }

.admin-sidebar { --bs-offcanvas-width: 17rem; --bs-offcanvas-bg: var(--app-navy); }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; background: var(--app-navy); color: #fff; padding: 1.1rem 0 1rem; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 1.1rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .12); margin-bottom: .75rem; }
.sidebar-nav { padding: 0 .65rem; flex: 1 1 auto; }
.sidebar-nav .nav-link { color: rgba(255, 255, 255, .78); border-radius: .5rem; padding: .6rem .85rem; font-weight: 500; }
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--app-blue); color: #fff; }
.sidebar-footer { padding: 1rem 1.1rem 0; border-top: 1px solid rgba(255, 255, 255, .12); }

@media (min-width: 992px) {
    .admin-sidebar { flex: 0 0 15rem; align-self: stretch; }
    .sidebar-inner { position: sticky; top: 0; height: 100vh; }
    .admin-content { padding: 2rem; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; color: var(--app-navy); margin: 0; }

.stat-card .card-body { padding: 1.1rem 1.25rem; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: #6b7686; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--app-navy); line-height: 1.15; }
.stat-card { border-top: 3px solid var(--app-blue); }
.stat-card.accent-red { border-top-color: var(--app-red); }

.table-card .card-header { background: #fff; font-weight: 700; color: var(--app-navy); }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #5b6675; background: #f8fafc; white-space: nowrap; border-bottom-width: 1px; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover, .sort-link.active { color: var(--app-blue); }
.ref-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; white-space: nowrap; }
.actions-col { white-space: nowrap; width: 1%; }
.actions-col .btn { --bs-btn-padding-x: .55rem; }
#studentsTable > :not(caption) > * > * { padding-left: .55rem; padding-right: .55rem; }
.name-col { min-width: 7.5rem; }

.filter-card .card-body { padding: 1rem 1.1rem; }
.filter-card .form-label { font-size: .75rem; margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .04em; color: #5b6675; }

.detail-list dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7686; font-weight: 600; }
.detail-list dd { margin-bottom: 1rem; font-size: 1rem; overflow-wrap: anywhere; }
.ssn-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .15em; }

/* Admin login */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--app-navy); padding: 1.5rem; }
.login-card { width: 100%; max-width: 24rem; border-radius: .85rem; border: 0; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.login-card .brand { color: var(--app-navy); }
.login-card .brand-mark { background: var(--app-navy); color: #fff; }

/* admin lists */
.row-inactive td { color: #6b7686; background: #fafbfc; }
.export-menu { min-width: 12rem; }
.add-btn-col { align-self: end; }
@media (max-width: 767.98px) { .add-btn-col .btn { width: 100%; } }
