/* ==========================================================================
   CANDIDATE PORTAL — "Sky" theme (matches the public site).
   Loaded by Views/candidate/layout.php for the dashboard and application pages.
   The login page adds Candidate-login-sky.css on top.
   ========================================================================== */
body {
	background: #f3f7fe;
	font-family: 'Inter', system-ui, sans-serif;
	color: #4a5672;

	/* Bootstrap colours mapped to the public site's palette, so every badge, link and
	   utility class on the portal uses the same blues and greens as the frontend */
	--bs-primary: #2563eb;
	--bs-primary-rgb: 37, 99, 235;
	--bs-primary-text-emphasis: #1d4ed8;
	--bs-primary-bg-subtle: #eaf2ff;
	--bs-primary-border-subtle: #c7dbfb;
	--bs-info: #0ea5e9;
	--bs-info-rgb: 14, 165, 233;
	--bs-info-text-emphasis: #0369a1;
	--bs-info-bg-subtle: #e0f2fe;
	--bs-info-border-subtle: #bae6fd;
	--bs-success: #12a150;
	--bs-success-rgb: 18, 161, 80;
	--bs-success-text-emphasis: #0e7a3c;
	--bs-success-bg-subtle: #e3f6ea;
	--bs-success-border-subtle: #bfe8cf;
	--bs-link-color: #2563eb;
	--bs-link-color-rgb: 37, 99, 235;
	--bs-link-hover-color: #1d4ed8;
	--bs-link-hover-color-rgb: 29, 78, 216;
}

.btn-primary {
	--bs-btn-bg: #2563eb;
	--bs-btn-border-color: #2563eb;
	--bs-btn-hover-bg: #1d4ed8;
	--bs-btn-hover-border-color: #1d4ed8;
	--bs-btn-active-bg: #1e40af;
	--bs-btn-active-border-color: #1e40af;
	--bs-btn-disabled-bg: #2563eb;
	--bs-btn-disabled-border-color: #2563eb;
}

.btn-outline-primary {
	--bs-btn-color: #2563eb;
	--bs-btn-border-color: #2563eb;
	--bs-btn-hover-bg: #2563eb;
	--bs-btn-hover-border-color: #2563eb;
	--bs-btn-active-bg: #1d4ed8;
	--bs-btn-active-border-color: #1d4ed8;
}

/* Bootstrap adds padding when a modal opens; the page must not shift */
body.modal-open {
	overflow: hidden;
	padding-right: 0 !important;
}

.main-content {
	padding: 28px 12px 56px;
}

/* ---------- Top bar ---------- */
.portal-nav {
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid #e1eafa;
	padding: 6px 0;
}

/* Seal and wordmark: the same sizes as the public site header */
.portal-nav .navbar-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0;
}

.brand-seal {
	display: block;
	flex: none;
	border-radius: 50%;
}

.brand-seal--portal {
	width: 64px;
	height: 64px;
}

.brand-text {
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1;
	white-space: nowrap;
}

.brand-word {
	color: #0a1633;
}

.brand-word--accent {
	font-weight: 600;
	color: transparent;
	background: linear-gradient(90deg, #2563eb 0%, #38bdf8 50%, #2563eb 100%);
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.portal-nav-tag {
	margin-left: 4px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #eaf2ff;
	color: #1d4ed8;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.portal-nav .navbar-toggler {
	width: 44px;
	height: 44px;
	border: 1px solid #d5e3fb;
	border-radius: 14px;
	color: #1d4ed8;
	box-shadow: none;
}

.portal-nav .nav-link {
	padding: 9px 16px !important;
	border-radius: 999px;
	color: #33405f;
	font-weight: 600;
	transition: background 0.2s ease, color 0.2s ease;
}

.portal-nav .nav-link:hover,
.portal-nav .nav-link.active {
	background: #eaf2ff;
	color: #1d4ed8;
}

.portal-nav-user {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 260px;
	padding: 7px 14px;
	border-radius: 999px;
	border: 1px solid #e1eafa;
	background: #f7faff;
	color: #33405f;
	font-size: 0.86rem;
	font-weight: 600;
}

.portal-nav-user span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.portal-nav-user i {
	color: #2563eb;
}

.portal-btn,
.portal-btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 22px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.92rem;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.portal-btn {
	border: 0;
	background: linear-gradient(135deg, #2563eb, #38bdf8);
	color: #ffffff;
	box-shadow: 0 16px 30px -16px rgba(37, 99, 235, 0.8);
}

.portal-btn:hover {
	transform: translateY(-2px);
	color: #ffffff;
	box-shadow: 0 20px 34px -16px rgba(37, 99, 235, 0.9);
}

.portal-btn-ghost {
	border: 1px solid #d5e3fb;
	background: #ffffff;
	color: #1d4ed8;
}

.portal-btn-ghost:hover {
	background: #eaf2ff;
	border-color: #2563eb;
	color: #1d4ed8;
}

.portal-btn-ghost.is-danger {
	color: #b42318;
	border-color: #f3c8c4;
}

.portal-btn-ghost.is-danger:hover {
	background: #fdecea;
	border-color: #b42318;
	color: #b42318;
}

.portal-btn--sm {
	padding: 8px 16px;
	font-size: 0.86rem;
}

/* ---------- Messages from the server ---------- */
.portal-alert {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 20px;
	padding: 14px 18px;
	border: 1px solid #e1eafa;
	border-left-width: 4px;
	border-radius: 16px;
	background: #ffffff;
	color: #0a1633;
	font-weight: 500;
	box-shadow: 0 16px 34px -28px rgba(37, 99, 235, 0.45);
}

.portal-alert i {
	margin-top: 3px;
}

.portal-alert.is-success { border-left-color: #12a150; }
.portal-alert.is-success i { color: #12a150; }
.portal-alert.is-danger { border-left-color: #d92d20; }
.portal-alert.is-danger i { color: #d92d20; }
.portal-alert.is-info { border-left-color: #2563eb; }
.portal-alert.is-info i { color: #2563eb; }

/* ---------- Footer ---------- */
.portal-footer {
	border-top: 1px solid #e1eafa;
	background: #ffffff;
	padding: 22px 0;
	color: #5a6785;
	font-size: 0.88rem;
}

.portal-footer a {
	color: #33405f;
	font-weight: 600;
	text-decoration: none;
}

.portal-footer a:hover {
	color: #1d4ed8;
}

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.portal-hero {
	position: relative;
	overflow: hidden;
	margin-bottom: 20px;
	padding: 38px 40px;
	border-radius: 26px;
	color: #ffffff;
	background: linear-gradient(90deg, #020024 0%, #060552 7%, #090979 21%, #0482c9 56%, #0ea5e9 100%);
	box-shadow: 0 36px 70px -40px rgba(9, 9, 121, 0.7);
}

.portal-hero::before,
.portal-hero::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.2);
	pointer-events: none;
}

.portal-hero::before { width: 300px; height: 300px; top: -160px; right: -80px; }
.portal-hero::after { width: 200px; height: 200px; bottom: -130px; right: 180px; }

.portal-hero > * {
	position: relative;
	z-index: 1;
}

.portal-hero-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.portal-kicker {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	padding: 5px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.26);
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.portal-hero h1 {
	margin: 0 0 8px;
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	color: #ffffff;
	text-shadow: 0 2px 16px rgba(2, 0, 36, 0.5);
}

.portal-hero p {
	margin: 0;
	max-width: 520px;
	color: rgba(255, 255, 255, 0.92);
	line-height: 1.65;
}

.portal-hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.portal-hero-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 999px;
	background: #ffffff;
	color: #1d4ed8;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 16px 30px -16px rgba(2, 0, 36, 0.7);
	transition: transform 0.2s ease;
}

.portal-hero-btn:hover {
	transform: translateY(-2px);
	color: #1d4ed8;
}

/* Four numbers under the welcome band */
.portal-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.portal-stat {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	border-radius: 20px;
	border: 1px solid #e1eafa;
	background: #ffffff;
	box-shadow: 0 22px 44px -34px rgba(37, 99, 235, 0.45);
}

.portal-stat-icon {
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eaf2ff;
	color: #2563eb;
	font-size: 1.1rem;
}

.portal-stat-icon.is-amber { background: #fff4de; color: #b25e09; }
.portal-stat-icon.is-indigo { background: #ecebff; color: #4338ca; }
.portal-stat-icon.is-green { background: #e3f6ea; color: #0e7a3c; }

.portal-stat-value {
	display: block;
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.1;
	color: #0a1633;
}

.portal-stat-label {
	display: block;
	color: #5a6785;
	font-size: 0.86rem;
}

/* Applications */
.portal-panel {
	border-radius: 24px;
	border: 1px solid #e1eafa;
	background: #ffffff;
	box-shadow: 0 30px 60px -40px rgba(37, 99, 235, 0.5);
}

.portal-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 22px 26px;
	border-bottom: 1px solid #e1eafa;
}

.portal-panel-head h2 {
	margin: 0;
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	color: #0a1633;
}

.portal-panel-head p {
	margin: 2px 0 0;
	color: #5a6785;
	font-size: 0.9rem;
}

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

.app-row {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(0, 1.4fr) auto;
	align-items: center;
	gap: 20px;
	padding: 20px 26px;
	border-bottom: 1px solid #eef3fc;
	transition: background 0.2s ease;
}

.app-row:last-child {
	border-bottom: 0;
	border-radius: 0 0 24px 24px;
}

.app-row:hover {
	background: #f7faff;
}

.app-role {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.app-role-icon {
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #2563eb, #38bdf8);
	color: #ffffff;
}

.app-role-title {
	display: block;
	color: #0a1633;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.app-role-meta {
	display: block;
	color: #5a6785;
	font-size: 0.85rem;
}

.app-cell-label {
	display: none;
	margin-bottom: 4px;
	color: #7c89a6;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 14px;
	border-radius: 999px;
	background: #eef1f6;
	color: #33405f;
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: capitalize;
}

.status-pill::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.status-pill.is-pending { background: #fff4de; color: #92500a; }
.status-pill.is-interview { background: #e3f1ff; color: #0b5cad; }
.status-pill.is-docs { background: #ecebff; color: #4338ca; }
.status-pill.is-success { background: #e3f6ea; color: #0e7a3c; }
.status-pill.is-closed { background: #fdecea; color: #b42318; }

.app-next {
	min-width: 0;
	font-size: 0.9rem;
}

.app-next-kind {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #1d4ed8;
	font-size: 0.76rem;
	font-weight: 700;
}

.app-next-when {
	display: block;
	color: #0a1633;
	font-weight: 700;
}

.app-next-when span {
	color: #1d4ed8;
	font-weight: 600;
}

.app-next-where {
	display: block;
	overflow: hidden;
	color: #5a6785;
	font-size: 0.82rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app-next-muted { color: #7c89a6; }
.app-next-good { color: #0e7a3c; font-weight: 700; }
.app-next-bad { color: #b42318; font-weight: 600; }

.portal-empty {
	padding: 56px 24px;
	text-align: center;
}

.portal-empty-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 18px;
	border-radius: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eaf2ff;
	color: #2563eb;
	font-size: 1.7rem;
}

.portal-empty h3 {
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-size: 1.2rem;
	font-weight: 600;
	color: #0a1633;
}

.portal-empty p {
	margin-bottom: 20px;
	color: #5a6785;
}

/* ---------- Apply form (opens over the dashboard) ---------- */
#autoApplyModal .modal-content {
	border-radius: 26px !important;
	overflow: hidden;
}

#autoApplyModal .modal-header {
	border-radius: 0 !important;
	background: linear-gradient(90deg, #060552 0%, #090979 30%, #0482c9 100%) !important;
}

#autoApplyModal .modal-title {
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-weight: 600 !important;
	letter-spacing: -0.02em;
}

#autoApplyModal .modal-body {
	background: #f3f7fe !important;
}

#autoApplyModal .card {
	border: 1px solid #e1eafa !important;
	border-radius: 20px !important;
	overflow: hidden;
	box-shadow: 0 22px 44px -36px rgba(37, 99, 235, 0.5) !important;
}

#autoApplyModal .card-header {
	border-bottom: 1px solid #e1eafa !important;
}

#autoApplyModal .card-header h6 {
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-weight: 600 !important;
	color: #0a1633 !important;
}

#autoApplyModal .card-header h6 i {
	color: #2563eb;
}

#autoApplyModal label {
	margin-bottom: 6px;
	color: #33405f !important;
	font-size: 0.76rem;
	letter-spacing: 0.04em;
}

#autoApplyModal .form-control,
#autoApplyModal .form-select {
	min-height: 46px;
	border: 1px solid #d5e3fb;
	border-radius: 14px;
	background-color: #f7faff;
	color: #0a1633;
}

#autoApplyModal .form-control:focus,
#autoApplyModal .form-select:focus {
	border-color: #2563eb;
	background-color: #ffffff;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

#autoApplyModal .input-group-text {
	border: 1px solid #d5e3fb;
	border-radius: 14px 0 0 14px;
	background: #eaf2ff;
	color: #1d4ed8;
}

#autoApplyModal .input-group > .form-control {
	border-radius: 0 14px 14px 0;
}

#autoApplyModal .btn-primary {
	padding: 12px 26px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #2563eb, #38bdf8);
	box-shadow: 0 16px 30px -16px rgba(37, 99, 235, 0.8) !important;
}

#autoApplyModal .btn-light {
	padding: 12px 26px;
	border: 1px solid #d5e3fb;
	border-radius: 999px;
	background: #ffffff;
	color: #33405f;
	font-weight: 600;
}

/* ==========================================================================
   APPLICATION DETAILS
   ========================================================================== */
.app-detail-container {
	color: #4a5672;
}

.app-detail-container h6,
.hero-title {
	font-family: "Sora", "Inter", system-ui, sans-serif;
}

.app-detail-container h6 {
	font-weight: 600 !important;
	letter-spacing: -0.01em;
	color: #0a1633 !important;
}

.app-detail-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.app-detail-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #1d4ed8;
	font-weight: 700;
	text-decoration: none;
}

.app-detail-back:hover {
	color: #0a1633;
}

.glass-card {
	background: #ffffff;
	border-radius: 24px;
	border: 1px solid #e1eafa;
	box-shadow: 0 30px 60px -44px rgba(37, 99, 235, 0.5);
}

/* Inner tinted blocks */
.app-detail-container .bg-light {
	background: #f7faff !important;
	border-color: #e1eafa !important;
	border-radius: 18px !important;
}

.app-detail-container .bg-white.border {
	border-color: #e1eafa !important;
	border-radius: 14px !important;
}

/* ---------- Header band ---------- */
.hero-app-header {
	position: relative;
	overflow: hidden;
	padding: 30px 32px;
	border-radius: 26px;
	color: #ffffff;
	background: linear-gradient(90deg, #020024 0%, #060552 7%, #090979 21%, #0482c9 56%, #0ea5e9 100%);
	box-shadow: 0 36px 70px -40px rgba(9, 9, 121, 0.7);
}

.hero-app-header::after {
	content: '';
	position: absolute;
	top: -150px;
	right: -70px;
	width: 300px;
	height: 300px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.2);
	pointer-events: none;
}

.hero-app-header > * {
	position: relative;
	z-index: 1;
}

/* ---------- "You are selected" banner: same sky gradient as the header band ---------- */
.offer-banner {
	position: relative;
	overflow: hidden;
	padding: 24px 28px;
	border-radius: 26px;
	color: #ffffff;
	background: linear-gradient(90deg, #020024 0%, #060552 7%, #090979 21%, #0482c9 56%, #0ea5e9 100%);
	box-shadow: 0 36px 70px -40px rgba(9, 9, 121, 0.7);
}

.offer-banner::after {
	content: '';
	position: absolute;
	bottom: -160px;
	right: -60px;
	width: 300px;
	height: 300px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.2);
	pointer-events: none;
}

.offer-banner > * {
	position: relative;
	z-index: 1;
}

.offer-banner h4 {
	font-family: "Sora", "Inter", system-ui, sans-serif;
	letter-spacing: -0.02em;
}

.offer-banner-icon {
	flex: none;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	color: #f59e0b;
	font-size: 1.5rem;
	box-shadow: 0 10px 24px -12px rgba(2, 0, 36, 0.8);
}

@media (max-width: 767.98px) {
	.offer-banner { padding: 20px 18px; border-radius: 22px; }
	.offer-banner h4 { font-size: 1.2rem; }
}

.hero-title {
	font-size: clamp(1.35rem, 2.6vw, 1.8rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.25;
	text-shadow: 0 2px 16px rgba(2, 0, 36, 0.5);
}

.hero-app-meta {
	color: rgba(255, 255, 255, 0.9);
}

/* ---------- Hiring steps ---------- */
.journey-stepper-wrap {
	position: relative;
	width: 100%;
	padding: 6px 0 2px;
	overflow: hidden;
}

.journey-stepper {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	width: 100%;
	margin: 10px 0 4px;
}

.journey-track {
	position: absolute;
	top: 20px;
	height: 4px;
	z-index: 1;
	border-radius: 4px;
	overflow: hidden;
}

.journey-stepper-line {
	position: absolute;
	inset: 0;
	background: #dbe8ff;
	border-radius: 4px;
}

.journey-progress-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	max-width: 100%;
	border-radius: 4px;
	background: linear-gradient(90deg, #2563eb, #38bdf8);
	transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.journey-progress-bar.rejected-line {
	background: linear-gradient(90deg, #12a150 0%, #d92d20 100%);
}

.journey-step {
	position: relative;
	z-index: 3;
	flex: 1;
	padding: 0 4px;
	text-align: center;
}

.journey-step-circle {
	width: 44px;
	height: 44px;
	margin-bottom: 8px;
	border-radius: 50%;
	border: 2.5px solid #c7dbfb;
	background: #ffffff;
	color: #5a6785;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.92rem;
	font-weight: 700;
	box-shadow: 0 0 0 5px #ffffff;
}

.journey-step.completed .journey-step-circle {
	background: #12a150;
	border-color: #12a150;
	color: #ffffff;
}

.journey-step.active .journey-step-circle {
	border-color: transparent;
	background: linear-gradient(135deg, #2563eb, #38bdf8);
	color: #ffffff;
	animation: pulse-ring 2s infinite;
}

.journey-step.rejected .journey-step-circle {
	background: #d92d20;
	border-color: #d92d20;
	color: #ffffff;
}

.journey-step-label {
	color: #5a6785;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.3;
}

.journey-step.active .journey-step-label,
.journey-step.completed .journey-step-label {
	color: #0a1633;
	font-weight: 700;
}

.journey-step.rejected .journey-step-label {
	color: #b42318;
	font-weight: 700;
}

@keyframes pulse-ring {
	0% { box-shadow: 0 0 0 5px #ffffff, 0 0 0 5px rgba(37, 99, 235, 0.4); }
	70% { box-shadow: 0 0 0 5px #ffffff, 0 0 0 13px rgba(37, 99, 235, 0); }
	100% { box-shadow: 0 0 0 5px #ffffff, 0 0 0 5px rgba(37, 99, 235, 0); }
}

/* ---------- Labels, chips and rows ---------- */
.section-header-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	padding: 4px 12px;
	border-radius: 999px;
	background: #eaf2ff;
	color: #1d4ed8;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.skill-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 2px 4px 4px 0;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
}

.skill-chip-matched { background: #e3f6ea; color: #0e7a3c; border: 1px solid #bfe8cf; }
.skill-chip-other { background: #ffffff; color: #33405f; border: 1px solid #d5e3fb; }
.skill-chip-req { background: #fff4de; color: #92500a; border: 1px solid #f8dfae; }

.interview-highlight-box {
	padding: 22px 24px;
	border-radius: 24px;
	border: 1px solid #b9d2fb;
	background: linear-gradient(135deg, #eef4ff 0%, #e3f1ff 100%);
}

.criteria-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid #e1eafa;
	background: #ffffff;
}

.criteria-row:last-child {
	margin-bottom: 0;
}

.app-detail-container .btn-primary {
	border: 0;
	background: linear-gradient(135deg, #2563eb, #38bdf8);
	font-weight: 700;
}

.app-detail-container .table {
	--bs-table-bg: transparent;
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 991.98px) {
	.portal-nav .navbar-collapse {
		margin-top: 12px;
		padding: 14px;
		border-radius: 18px;
		border: 1px solid #e1eafa;
		background: #ffffff;
	}

	.portal-nav-user { max-width: none; width: 100%; }
	.portal-nav .portal-btn-ghost { width: 100%; }

	.portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	/* Each application becomes a card */
	.app-row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 16px;
		align-items: start;
	}

	.app-role,
	.app-action { grid-column: 1 / -1; }
	.app-action .portal-btn { width: 100%; }
	.app-cell-label { display: block; }
}

@media (max-width: 767.98px) {
	.main-content { padding: 18px 14px 40px; }

	.portal-hero { padding: 26px 22px; border-radius: 22px; }
	.portal-hero-actions,
	.portal-hero-btn { width: 100%; justify-content: center; }

	.portal-stats { gap: 10px; }
	.portal-stat { padding: 14px; gap: 10px; border-radius: 18px; }
	.portal-stat-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
	.portal-stat-value { font-size: 1.35rem; }
	.portal-stat-label { font-size: 0.8rem; }

	.portal-panel { border-radius: 20px; }
	.portal-panel-head { padding: 18px; }
	.app-row { padding: 18px; }
	.app-row:last-child { border-radius: 0 0 20px 20px; }

	.hero-app-header { padding: 22px 18px; border-radius: 22px; }
	.glass-card { border-radius: 20px; }
	.interview-highlight-box { padding: 18px 16px; border-radius: 20px; }

	.journey-track { top: 17px; }

	.journey-step-circle {
		width: 34px;
		height: 34px;
		margin-bottom: 6px;
		border-width: 2px;
		font-size: 0.78rem;
		box-shadow: 0 0 0 3px #ffffff;
	}

	.journey-step-label { font-size: 0.66rem; }

	.criteria-row { flex-wrap: wrap; }

	.modal-dialog:not(.modal-fullscreen-md-down) { margin: 0.5rem; }
}

@media (max-width: 575.98px) {
	.portal-nav .navbar-brand { gap: 10px; }
	.brand-seal--portal { width: 54px; height: 54px; }
	.brand-text { font-size: 1.08rem; }
	.portal-nav-tag { display: none; }
}

@media (max-width: 359.98px) {
	.brand-text { font-size: 0.98rem; }
}

/* ==========================================================================
   PHONE AND TABLET: nothing wider than the screen, nothing overlapping
   ========================================================================== */

/* Long text in badges (qualifications, stage names) wraps instead of pushing the page sideways */
.glass-card .badge,
.hero-app-header .badge {
	max-width: 100%;
	white-space: normal;
	overflow-wrap: break-word;
	text-align: left;
	line-height: 1.35;
}

/* Laptop widths: the full menu row is tight, so the signed-in email gives way and links stay on one line */
.portal-nav .nav-link { white-space: nowrap; }

@media (min-width: 992px) and (max-width: 1199.98px) {
	.portal-nav-user { display: none; }
}

/* Short status pills stay on one line */
.schedule-table .badge,
.verify-row .badge,
.journey-step .badge {
	white-space: nowrap;
}

/* Interview schedule: each round becomes a card instead of a squeezed four-column table */
@media (max-width: 767.98px) {
	.schedule-table thead { display: none; }

	.schedule-table,
	.schedule-table tbody,
	.schedule-table tr,
	.schedule-table td {
		display: block;
		width: 100%;
	}

	.schedule-table tr {
		margin-bottom: 10px;
		padding: 12px 14px;
		border: 1px solid #e1eafa;
		border-radius: 16px;
		background: #ffffff;
	}

	.schedule-table tr:last-child { margin-bottom: 0; }

	.schedule-table td {
		padding: 4px 0;
		border: 0;
		background: transparent !important;
		box-shadow: none !important;
	}

	.schedule-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		font-size: 0.68rem;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		color: #5a6785;
	}

	.table-responsive:has(> .schedule-table) { overflow: visible; }
}

/* Date under each hiring step name: always on its own line, never split */
.journey-step-date {
	display: block;
	margin-top: 2px;
	font-size: 0.68rem;
	white-space: nowrap;
}

/* Hiring steps: a vertical list on phones and small tablets, so all six steps and their dates fit */
@media (max-width: 767.98px) {
	.journey-stepper {
		flex-direction: column;
		align-items: stretch;
		margin: 4px 0;
	}

	.journey-track { display: none; }

	.journey-step {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		padding: 6px 0;
		text-align: left;
	}

	.journey-step-label { padding-top: 7px; }

	/* Connector between steps, from the bottom of one circle to the top of the next */
	.journey-step:not(:last-child)::after {
		content: '';
		position: absolute;
		left: 16px;
		top: 40px;
		bottom: -6px;
		width: 2px;
		border-radius: 2px;
		background: #dbe8ff;
	}

	.journey-step.completed:not(:last-child)::after { background: #12a150; }

	.journey-step-circle {
		flex: none;
		margin-bottom: 0;
	}

	.journey-step-label { font-size: 0.86rem; }

}

/* ==========================================================================
   PHONES: app-style layout (compact top bar, bottom tabs, card lists)
   ========================================================================== */
.portal-nav-avatar {
	display: none;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #2563eb, #38bdf8);
	color: #ffffff;
	font-weight: 700;
	font-size: 1rem;
	box-shadow: 0 10px 20px -12px rgba(37, 99, 235, 0.9);
}

.portal-nav-avatar.is-static { display: inline-flex; width: 48px; height: 48px; font-size: 1.15rem; }

/* Bottom tab bar */
.portal-tabbar {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1030;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-top: 1px solid #e1eafa;
	box-shadow: 0 -12px 30px -24px rgba(37, 99, 235, 0.5);
}

.portal-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	min-height: 54px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: #5a6785;
	font-size: 0.72rem;
	font-weight: 600;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.portal-tab-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 30px;
	border-radius: 999px;
	font-size: 1.05rem;
	transition: background 0.2s ease, color 0.2s ease;
}

.portal-tab.active { color: #1d4ed8; font-weight: 700; }
.portal-tab.active .portal-tab-icon { background: #eaf2ff; }
.portal-tab:active .portal-tab-icon { background: #dbe8ff; }

/* Account sheet that slides up from the tab bar */
.portal-sheet.offcanvas-bottom {
	height: auto;
	max-height: 85vh;
	border: 0;
	border-radius: 24px 24px 0 0;
	padding-bottom: env(safe-area-inset-bottom);
}

.portal-sheet-grabber {
	width: 40px;
	height: 5px;
	margin: 10px auto 0;
	border-radius: 999px;
	background: #d5e3fb;
}

.portal-sheet .offcanvas-header { padding: 12px 20px 4px; }

.portal-sheet .offcanvas-title {
	margin: 0;
	font-family: "Sora", "Inter", system-ui, sans-serif;
	font-size: 1.15rem;
	font-weight: 600;
	color: #0a1633;
}

.portal-sheet .offcanvas-body { padding: 12px 20px 20px; }

.portal-sheet-user {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
	margin-bottom: 16px;
	padding: 14px;
	border-radius: 18px;
	background: #f3f7fe;
}

.portal-sheet-user > div { min-width: 0; }
.portal-sheet-label { display: block; color: #7c89a6; font-size: 0.76rem; font-weight: 600; }
.portal-sheet-email { display: block; color: #0a1633; font-weight: 700; overflow-wrap: anywhere; }

.portal-sheet-list {
	margin-bottom: 16px;
	border: 1px solid #e1eafa;
	border-radius: 18px;
	overflow: hidden;
}

.portal-sheet-list a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid #eef3fc;
	color: #0a1633;
	font-weight: 600;
	text-decoration: none;
}

.portal-sheet-list a:last-child { border-bottom: 0; }
.portal-sheet-list a:active { background: #f3f7fe; }
.portal-sheet-list a i:first-child { width: 20px; color: #2563eb; text-align: center; }
.portal-sheet-list a i:last-child { margin-left: auto; color: #b3c0d8; font-size: 0.8rem; }

.portal-sheet .portal-btn-ghost { min-height: 48px; }

.portal-sheet-foot {
	margin: 16px 0 0;
	color: #7c89a6;
	font-size: 0.76rem;
	text-align: center;
}

/* The whole application card is tappable (stretched link on its button) */
.app-row { position: relative; }

/* No transform (or filter) on the stretched button: either one makes the button the containing block
   of its ::after, which then shrinks from the whole row to the button, hover is lost, and the row
   flickers. The hover glow is driven by the row instead. */
@media (min-width: 768px) {
	.app-row .stretched-link:hover { transform: none; }

	.app-row:hover .stretched-link {
		box-shadow: 0 20px 34px -16px rgba(37, 99, 235, 0.9);
	}
}

@media (max-width: 767.98px) {
	body { -webkit-tap-highlight-color: transparent; }

	body.has-tabbar .portal-tabbar { display: grid; }
	body.has-tabbar .portal-footer { display: none; }
	body.has-tabbar .main-content { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

	/* Top bar: brand + avatar; the menu lives in the tabs and the account sheet */
	body.has-tabbar .portal-nav .navbar-toggler,
	body.has-tabbar .portal-nav .navbar-collapse { display: none !important; }
	body.has-tabbar .portal-nav-avatar { display: inline-flex; }
	.portal-nav { padding: calc(4px + env(safe-area-inset-top)) 0 4px; }
	.portal-nav .navbar-brand { gap: 10px; }
	.brand-seal--portal { width: 44px; height: 44px; }
	.brand-text { font-size: 1.02rem; }

	.main-content { padding-top: 14px; }

	/* Welcome band: compact greeting card */
	.portal-hero { margin-bottom: 18px; padding: 22px 20px; }
	.portal-hero-inner { gap: 16px; }
	.portal-hero h1 { margin-bottom: 4px; font-size: 1.35rem; }
	.portal-hero p { font-size: 0.88rem; line-height: 1.5; }
	.portal-hero-btn { padding: 11px 20px; }

	/* Applications: separate cards instead of one bordered table */
	.portal-panel { border: 0; background: transparent; box-shadow: none; }
	.portal-panel-head { padding: 0 4px 12px; border-bottom: 0; }
	.portal-panel-head h2 { font-size: 1.1rem; }
	.portal-panel-head p { font-size: 0.84rem; }

	.app-list { display: grid; gap: 12px; }

	.app-row,
	.app-row:last-child {
		gap: 14px 12px;
		padding: 16px;
		border: 1px solid #e1eafa;
		border-radius: 20px;
		background: #ffffff;
		box-shadow: 0 18px 36px -30px rgba(37, 99, 235, 0.55);
		transition: transform 0.15s ease, background 0.15s ease;
	}

	.app-row:hover { background: #ffffff; }
	.app-row:active { transform: scale(0.985); background: #f7faff; }

	.app-role-icon { width: 42px; height: 42px; border-radius: 13px; }
	.app-next-where { white-space: normal; }

	.app-action .portal-btn {
		justify-content: space-between;
		min-height: 46px;
		padding: 10px 16px;
		border-radius: 14px;
		background: #f3f7fe;
		color: #1d4ed8;
		box-shadow: none;
	}

	.app-action .portal-btn:hover { transform: none; color: #1d4ed8; box-shadow: none; }

	.portal-empty { padding: 40px 20px; border: 1px solid #e1eafa; border-radius: 20px; background: #ffffff; }

	/* Application page */
	.app-detail-top { margin-bottom: 12px; }

	.app-detail-back {
		padding: 8px 14px 8px 10px;
		border: 1px solid #e1eafa;
		border-radius: 999px;
		background: #ffffff;
	}

	.app-detail-back:active { background: #eaf2ff; }

	.schedule-cta,
	.schedule-cta .btn { width: 100%; }

	.schedule-cta .btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 46px;
	}

	/* Apply form: full-screen sheet with the submit bar pinned to the bottom */
	#autoApplyModal .modal-content { border-radius: 0 !important; }
	#autoApplyModal .modal-header { padding: calc(16px + env(safe-area-inset-top)) 18px 16px !important; }
	#autoApplyModal .modal-title { font-size: 1.15rem; }
	#autoApplyModal .modal-body { padding: 14px !important; }
	#autoApplyModal .card { margin-bottom: 14px !important; border-radius: 18px !important; }
	#autoApplyModal .card-header { padding: 14px 16px !important; }
	#autoApplyModal .card-body { padding: 16px !important; }

	/* 16px stops iOS Safari zooming into a field on focus */
	#autoApplyModal .form-control,
	#autoApplyModal .form-select { font-size: 16px; }

	#autoApplyModal .apply-actions {
		position: sticky;
		bottom: -14px;
		z-index: 5;
		margin: 16px -14px -14px !important;
		padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
		border-top: 1px solid #e1eafa;
		background: rgba(255, 255, 255, 0.96);
	}

	#autoApplyModal .apply-actions .btn { flex: 1; min-height: 48px; }
	#autoApplyModal .apply-actions .btn-primary { flex: 2; }
}

@media (prefers-reduced-motion: reduce) {
	.app-row:active { transform: none; }

	.journey-step.active .journey-step-circle {
		animation: none;
	}
}

@media print {
	.no-print,
	.portal-nav,
	.portal-footer {
		display: none !important;
	}

	.glass-card,
	.hero-app-header {
		box-shadow: none !important;
		border: 1px solid #cccccc !important;
	}
}
