/* ============================================================
   Eligi5 — AUTH PORTAL (public/student_login.php, mentor_login.php,
   admin_login.php)
   Extends auth.css with a split-panel layout, role theming,
   and micro-interactions. Uses the same design tokens as
   style.css so it inherits the site's color grading exactly.
   ============================================================ */

.auth-portal {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 0.1rem) 1.25rem 3rem;
  background: var(--grad-mesh), var(--c-white);
}

.auth-panel {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  background: var(--c-white);
  border: 1px solid var(--c-gray-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

/* ---------- Left: brand / visual side ---------- */
.auth-visual {
  position: relative;
  padding: clamp(2rem, 3.5vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--grad-dark);
  color: var(--c-white);
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(65% 55% at 20% 15%, rgba(126, 217, 87, 0.35) 0%, rgba(126, 217, 87, 0) 60%),
    radial-gradient(55% 45% at 90% 85%, rgba(0, 200, 150, 0.30) 0%, rgba(0, 200, 150, 0) 60%);
  pointer-events: none;
}

.auth-visual > * { position: relative; z-index: 1; }

.auth-visual-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  color: var(--c-green);
  margin-bottom: 1.75rem;
}
.auth-visual-icon svg { width: 26px; height: 26px; }

.auth-visual h2 {
  font-size: var(--fs-h4);
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--c-white);
}
.auth-visual h2 span { color: var(--c-green); }

.auth-visual p.auth-visual-sub {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 1.75rem;
  max-width: 30ch;
}

.auth-visual-points {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.auth-visual-points li {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.85);
}
.auth-visual-points .point-mark {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(126, 217, 87, 0.18);
  border: 1px solid rgba(126, 217, 87, 0.4);
  display: flex; align-items: center; justify-content: center;
  margin-top: 0.1rem;
}
.auth-visual-points .point-mark svg { width: 11px; height: 11px; color: var(--c-green); }

.auth-visual-note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.1rem;
  margin-top: auto;
  width: 100%;
}

/* ---------- Right: form side ---------- */
.auth-form-side {
  padding: clamp(2rem, 3.5vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height:470px;
}

.auth-form-side .brand { margin-bottom: 1.5rem; }
.auth-form-side h1 { font-size: var(--fs-h3); margin-bottom: 0.35rem; }
.auth-form-side p.auth-sub { color: var(--c-ink-60); font-size: 0.92rem; margin-bottom: 1.6rem; margin-top: 5px; }

/* Role switcher */
.auth-roles {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  background: var(--c-gray);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-gray-line);
}
.auth-roles a {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.5rem;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-ink-60);
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-roles a:hover { color: var(--c-dark); }
.auth-roles a.active {
  background: var(--c-white);
  color: var(--c-dark);
  box-shadow: var(--shadow-soft);
}

/* Alert */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: #FDECEC;
  border: 1px solid #F5C2C2;
  color: #B42318;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  animation: auth-alert-in 0.35s var(--ease-spring) both;
}
.auth-alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
@keyframes auth-alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.auth-card-shake { animation: auth-shake 0.5s var(--ease-out); }

/* Fields */
.auth-field { margin-bottom: 1.1rem; }
.auth-field label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 0.4rem; }
.auth-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.auth-input-wrap svg.field-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--c-ink-40);
  pointer-events: none;
}
.auth-field input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-gray-line);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--c-gray);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--c-green-deep);
  background: var(--c-white);
  box-shadow: 0 0 0 4px rgba(126, 217, 87, 0.16);
}
.auth-field input:invalid:not(:placeholder-shown) { border-color: #E4A2A2; }

.pw-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-ink-40);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.pw-toggle:hover { background: var(--c-gray-line); color: var(--c-dark); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.is-visible .eye-on { display: none; }
.pw-toggle.is-visible .eye-off { display: block; }

/* Submit button loading state */
.auth-card .btn.btn-submit { width: 100%; margin-top: 0.25rem; position: relative; }
.btn-submit .btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(17,17,17,0.25);
  border-top-color: var(--c-dark);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
.btn-submit.is-loading .btn-label,
.btn-submit.is-loading .btn-icon { opacity: 0; }
.btn-submit.is-loading .btn-spinner {
  display: block;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.btn-submit.is-loading { pointer-events: none; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.88rem; color: var(--c-ink-60); }
.auth-switch a { font-weight: 700; color: var(--c-green-deep); }

.auth-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  font-size: 0.76rem;
  color: var(--c-ink-40);
}
.auth-secure-note svg { width: 13px; height: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth-panel { grid-template-columns: 1fr; max-width: 460px; }
  .auth-visual { order: -1; padding: 1.75rem clamp(1.5rem, 5vw, 2.5rem); }
  .auth-visual-points { display: none; }
  .auth-visual-icon { margin-bottom: 1rem; }
  .auth-visual p.auth-visual-sub { margin-bottom: 0; }
  .auth-visual-note { display: none; }
}

@media (max-width: 640px) {
  .auth-portal { padding: calc(var(--nav-h) + 1.5rem) 1rem 2rem; }
  .auth-form-side, .auth-visual { padding: 1.5rem 1.35rem; }
}

/* ============================================================
   ADD-ON: registration variant (student_registerv2v2.php)
   Wider panel + multi-field rows + select styling + captcha.
   Everything above still applies — this only adds to it.
   ============================================================ */

.auth-panel--wide {
  max-width: 1080px;
  grid-template-columns: 0.8fr 1.2fr;
}
@media (max-width: 980px) {
  .auth-panel--wide { max-width: 480px; }
}

/* Two-up field row (first/last name, email/phone, degree/specialization) */
.auth-panel--wide .auth-field-row {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 1rem;
}
@media (max-width: 640px) {
  .auth-field-row { grid-template-columns: 1fr; gap: 0; }
}

/* Select fields — same shell as text inputs, plus a custom chevron */
.auth-field select {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 2.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-gray-line);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--c-dark);
  background: var(--c-gray);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-field select::-ms-expand { display: none; }
.auth-field select:focus {
  outline: none;
  border-color: var(--c-green-deep);
  background-color: var(--c-white);
  box-shadow: 0 0 0 4px rgba(126, 217, 87, 0.16);
}
.auth-input-wrap.auth-select-wrap::after {
  content: '';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 1.6px solid var(--c-ink-40);
  border-bottom: 1.6px solid var(--c-ink-40);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.auth-field .auth-select-wrap {
  display: block;
  width: 100%;
}

.auth-field .auth-select-wrap select {
  display: block;
  width: 100%;
}

.auth-panel--wide .auth-field > .auth-select-wrap::after {
  left: auto;
  right: 1rem;
}

/* Plain text input with no left icon (specialization free-text, captcha entry) */
.auth-field input.auth-input-plain {
  padding-left: 1rem;
}

/* Captcha */
.auth-captcha {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.auth-captcha-code {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--c-gray);
  border: 1.5px dashed var(--c-gray-line);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.35em;
  color: var(--c-dark);
  user-select: none;
}
.auth-captcha-refresh {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-gray-line);
  background: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink-60);
  cursor: pointer;
  font: inherit;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.auth-captcha-refresh:hover { background: var(--c-gray); color: var(--c-dark); transform: rotate(90deg); }
.auth-captcha-refresh svg { width: 18px; height: 18px; }

/* Terms text under the submit button */
.auth-terms {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--c-ink-40);
  text-align: center;
  margin-top: 1rem;
}
.auth-terms a { color: var(--c-green-deep); font-weight: 700; }

/* ============================================================
   BUGFIX: remove false-positive red border on empty required
   fields that have no placeholder attribute (first/last name,
   email, phone on the registration page).
   ============================================================ */
.auth-field input:invalid:not(:placeholder-shown) {
  border-color: var(--c-gray-line);
}
.auth-field input:invalid:not(:focus):not(:placeholder-shown):not([value=""]) {
  border-color: #E4A2A2;
}

/* ============================================================
   BUGFIX: on the wide registration panel, stop the visual side
   from stretching into one tall blank slab as the form grows —
   pin it near the top and let it scroll with the page instead.
   ============================================================ */
/* Visual panel stretches to match the form's full height (no gap) —
   only its inner content sticks near the top while scrolling. */
.auth-panel--wide .auth-visual {
  align-self: stretch;
}
/* ============================================================
   ADD-ON: fit the registration page in one viewport WITHOUT
   breaking the type scale — every size below is the same
   design-token hierarchy as the login pages, just scaled down
   proportionally with clamp() instead of flat overrides.
   ============================================================ */
.auth-portal--fit {
  padding-top: calc(var(--nav-h) + 0.75rem);
  padding-bottom: 0.75rem;
  align-items: flex-start;
}

.auth-panel--wide {
  height: calc(100dvh - var(--nav-h) - 1.5rem);
  max-height: calc(100dvh - var(--nav-h) - 1.5rem);
  grid-template-rows: minmax(0, 1fr);
}
.auth-panel--wide .auth-visual,
.auth-panel--wide .auth-form-side {
  min-height: 0;
}

.auth-panel--wide .auth-visual {
  padding: clamp(1.15rem, 2vw, 1.8rem);
  justify-content: flex-start;
  gap: 0.9rem;
}
.auth-panel--wide .auth-visual > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1;
}
.auth-panel--wide .auth-visual-icon { width: clamp(40px, 4vw, 48px); height: clamp(40px, 4vw, 48px); margin-bottom: 0.8rem; }
.auth-panel--wide .auth-visual-icon svg { width: auto; height: 28px; }
.auth-panel--wide .auth-visual h2 { font-size: clamp(1.2rem, 1.8vw, 1.6rem); margin-bottom: 0.45rem; }
.auth-panel--wide .auth-visual-sub { font-size: 0.8rem; line-height: 1.45; margin-bottom: 0.75rem; max-width: 30ch; }
.auth-panel--wide .auth-visual-points { gap: 0.45rem; margin-bottom: 0.35rem; }
.auth-panel--wide .auth-visual-points li { font-size: 0.76rem; line-height: 1.35; }
.auth-panel--wide .auth-visual-note { padding-top: 0.75rem; font-size: 0.72rem; }

.auth-panel--wide .auth-form-side {
  padding: clamp(0.75rem, 1.5vw, 1.15rem);
  padding-bottom: clamp(0.75rem, 1.5vw, 1.15rem);
  overflow: visible;
  justify-content: flex-start;
}
.auth-panel--wide .auth-form-side .brand { margin-bottom: 1rem; }
.auth-panel--wide h1 { font-size: clamp(1.2rem, 1.8vw, 1.65rem); margin-bottom: 0.1rem; }
.auth-panel--wide .auth-sub { font-size: 0.76rem; margin-bottom: 0.45rem; line-height: 1.35; }

.auth-panel--wide .auth-field-row { gap: 0.45rem; }
.auth-panel--wide .auth-field { margin-bottom: 0.28rem; width: 100%; }
.auth-panel--wide .auth-field label { font-size: 0.68rem; margin-bottom: 0.16rem; }
.auth-panel--wide .auth-field input,
.auth-panel--wide .auth-field select {
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
  font-size: 0.8rem;
  min-height: 34px;
}
.auth-panel--wide .auth-input-wrap svg.field-icon { width: 15px; height: 15px; }
.auth-panel--wide .auth-captcha { margin-bottom: 0.25rem; }
.auth-panel--wide .auth-captcha-code,
.auth-panel--wide .auth-captcha-refresh { height: 34px; }
.auth-panel--wide .auth-captcha-code { font-size: 0.92rem; padding: 0.4rem 0.8rem; }
.auth-panel--wide .auth-captcha-refresh { width: 38px; }
.auth-panel--wide .btn-submit {
  position: static;
  margin-top: 0.2rem;
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
}
.auth-panel--wide .auth-terms { margin-top: 0.9rem; font-size: 0.64rem; line-height: 1.35; }
.auth-panel--wide .auth-switch { margin-top: 0.42rem; font-size: 0.74rem; }

.auth-portal--fit {
  align-items: flex-start;
}
select#industry {
  width: 100%;
}

/* ============================================================
   ADD-ON: subscription / checkout (public/subscription.php)
   ============================================================ */
.auth-price-block {
  background: var(--c-gray);
  border: 1.5px solid var(--c-gray-line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}
.auth-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--c-ink-60);
  padding: 0.35rem 0;
}
.auth-price-row.discount { color: var(--c-green-deep); font-weight: 600; }
.auth-price-row.total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--c-gray-line);
  font-weight: 700;
  color: var(--c-dark);
}
.auth-price-row.total strong {
  font-size: 1.35rem;
  color: var(--c-green-deep);
}

.auth-mentor-key-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}
.auth-mentor-key-row .auth-input-wrap { flex: 1; }
.auth-mentor-key-row .btn-apply {
  flex: none;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--c-dark);
  background: var(--c-dark);
  color: var(--c-white);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast), opacity var(--dur-fast);
}
.auth-mentor-key-row .btn-apply:hover { opacity: 0.9; }
.auth-mentor-key-row .btn-apply.loading { opacity: 0.65; pointer-events: none; }

.auth-discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(126, 217, 87, 0.15);
  border: 1px solid rgba(126, 217, 87, 0.35);
  color: var(--c-green-deep);
  font-size: 0.8rem;
  font-weight: 700;
}
.auth-discount-badge svg { width: 14px; height: 14px; }
.auth-discount-badge .badge-remove {
  margin-left: 0.25rem;
  opacity: 0.6;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  display: flex;
}
.auth-discount-badge .badge-remove:hover { opacity: 1; }

.auth-checkout-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-gray-line);
}
.auth-checkout-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: var(--c-ink-60);
  font-weight: 500;
}
.auth-checkout-features .feature-mark {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(126, 217, 87, 0.15);
  border: 1px solid rgba(126, 217, 87, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-green-deep);
}
.auth-checkout-features .feature-mark svg { width: 13px; height: 13px; }


/* ============================================================
   ADD-ON: student profile page (student/student_myprofile.php)
   Appended-only, scoped profile styling that follows the auth
   portal and student dashboard visual language.
   ============================================================ */
.profile-page-wrapper {
  --profile-ink: var(--c-dark, #111111);
  --profile-muted: var(--c-ink-60, #6B6B6B);
  --profile-faint: var(--c-ink-40, #9A9E98);
  --profile-bg: var(--c-gray, #F7F8FA);
  --profile-card: var(--c-white, #FFFFFF);
  --profile-line: var(--c-gray-line, #E7EAE6);
  --profile-green: var(--c-green, #7ED957);
  --profile-green-deep: var(--c-green-deep, #4FAE2B);
  --profile-mint: #00C896;
  --profile-gold: #E8A100;
  --profile-gold-soft: #FFF6E5;
  --profile-red: #E5484D;
  --profile-red-soft: #FFF3F3;
  --profile-blue: #2F80ED;
  --profile-blue-soft: #EEF6FF;
  --profile-radius: 14px;
  --profile-shadow: 0 18px 50px rgba(17, 17, 17, 0.08);
  --profile-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --profile-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: calc(100svh - var(--header-h, 72px));
  padding: clamp(1rem, 2vw, 1.5rem);
  background: var(--grad-mesh, radial-gradient(circle at 12% 8%, rgba(126, 217, 87, 0.14), transparent 32%)), var(--profile-bg);
  color: var(--profile-ink);
  font-family: 'Manrope', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.profile-page-wrapper * {
  box-sizing: border-box;
}

.profile-page-wrapper a {
  transition: color var(--dur-fast, 160ms), background var(--dur-fast, 160ms), transform var(--dur-fast, 160ms);
}

.profile-alert {
  max-width: 1400px;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--profile-radius);
  border: 1.5px solid var(--profile-line);
  background: var(--profile-card);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
  animation: profile-rise 0.42s var(--profile-spring) both;
}
.profile-alert-success { color: var(--profile-green-deep); border-color: rgba(126, 217, 87, 0.38); background: rgba(126, 217, 87, 0.13); }
.profile-alert-error { color: #B42318; border-color: #F5C2C2; background: #FDECEC; }

.profile-hero {
  max-width: 1400px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 2.4vw, 2rem);
  border-radius: var(--radius-lg, 22px);
  color: var(--c-white, #FFFFFF);
  background:
    radial-gradient(70% 95% at 12% 5%, rgba(126, 217, 87, 0.38) 0%, rgba(126, 217, 87, 0) 64%),
    linear-gradient(135deg, #111111 0%, #1F3428 58%, #4FAE2B 140%);
  box-shadow: var(--profile-shadow);
  overflow: hidden;
  position: relative;
}
.profile-hero::after {
  content: '';
  position: absolute;
  inset: auto -8% -70% 48%;
  height: 180px;
  background: radial-gradient(circle, rgba(0, 200, 150, 0.26), transparent 65%);
  pointer-events: none;
}
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero-eyebrow {
  display: inline-flex;
  margin-bottom: 0.65rem;
  color: var(--profile-green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-hero h1 {
  margin: 0;
  color: var(--c-white, #FFFFFF);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.profile-hero p {
  max-width: 52ch;
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.94rem;
}

.hero-edit-btn,
.profile-page-wrapper .edit-btn,
.profile-page-wrapper .submit-btn,
.profile-page-wrapper .upload-btn,
.profile-page-wrapper .add-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast, 160ms) var(--profile-spring), box-shadow var(--dur-fast, 160ms), background var(--dur-fast, 160ms), color var(--dur-fast, 160ms);
}
.hero-edit-btn,
.profile-page-wrapper .submit-btn {
  min-height: 44px;
  padding: 0.85rem 1.2rem;
  color: var(--profile-ink);
  background: linear-gradient(135deg, var(--profile-green), var(--profile-mint));
  box-shadow: 0 14px 30px rgba(79, 174, 43, 0.26);
}
.hero-edit-btn:hover,
.profile-page-wrapper .submit-btn:hover,
.profile-page-wrapper .upload-btn:hover,
.profile-page-wrapper .add-row-btn:hover {
  transform: translateY(-2px);
}
.hero-edit-btn:focus-visible,
.profile-page-wrapper button:focus-visible,
.profile-page-wrapper a:focus-visible,
.profile-page-wrapper input:focus-visible,
.profile-page-wrapper select:focus-visible,
.profile-page-wrapper textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(126, 217, 87, 0.2);
}

.profile-page-wrapper .dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.profile-page-wrapper .sidebar,
.profile-page-wrapper .main-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.profile-page-wrapper .card {
  position: relative;
  padding: clamp(1rem, 1.7vw, 1.35rem);
  border: 1.5px solid var(--profile-line);
  border-radius: var(--profile-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.05);
  overflow: hidden;
  transition: transform 220ms var(--profile-ease), border-color 220ms var(--profile-ease), box-shadow 220ms var(--profile-ease);
}
.profile-page-wrapper .card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--profile-green);
}
.profile-page-wrapper .card:hover {
  transform: translateY(-3px);
  border-color: rgba(126, 217, 87, 0.58);
  box-shadow: 0 14px 32px rgba(17, 17, 17, 0.08);
}
.profile-page-wrapper .card-accent-gold::before { background: var(--profile-gold); }
.profile-page-wrapper .card-accent-blue::before { background: var(--profile-mint); }
.profile-page-wrapper .card-accent-green::before { background: var(--profile-green-deep); }

.profile-page-wrapper .profile-top {
  text-align: center;
  background:
    linear-gradient(180deg, rgba(126, 217, 87, 0.12), rgba(255, 255, 255, 0) 46%),
    var(--profile-card);
}
.profile-page-wrapper .photo-container {
  width: 104px;
  height: 104px;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--profile-faint);
  font-size: 5rem;
  background: var(--profile-bg);
  border: 4px solid var(--profile-card);
  box-shadow: 0 0 0 2px rgba(126, 217, 87, 0.35), 0 14px 28px rgba(17, 17, 17, 0.1);
  overflow: hidden;
}
.profile-page-wrapper .photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-page-wrapper .profile-name {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--profile-ink);
  font-size: 1.18rem;
  line-height: 1.25;
}
.profile-page-wrapper .profile-email {
  margin: 0.45rem 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--profile-muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.profile-page-wrapper .profile-icon { color: var(--profile-green-deep); flex: none; }
.profile-page-wrapper .skill-badge,
.profile-page-wrapper .chip,
.profile-page-wrapper .chip-empty {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}
.profile-page-wrapper .skill-badge,
.profile-page-wrapper .chip.strength {
  color: var(--profile-green-deep);
  background: rgba(126, 217, 87, 0.18);
  border: 1px solid rgba(126, 217, 87, 0.34);
}
.profile-page-wrapper .chip.weakness {
  color: #B42318;
  background: var(--profile-red-soft);
  border: 1px solid #F5C2C2;
}
.profile-page-wrapper .chip-empty {
  color: var(--profile-muted);
  background: var(--profile-bg);
  border: 1px dashed var(--profile-line);
}
.profile-page-wrapper .chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.profile-page-wrapper .stats-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}
.profile-page-wrapper .stat-box,
.profile-page-wrapper .info-item,
.profile-page-wrapper .course-mini-card,
.profile-page-wrapper .history-item,
.profile-page-wrapper .readonly-panel,
.profile-page-wrapper .upload-panel,
.profile-page-wrapper .saved-file-card {
  border: 1.5px solid var(--profile-line);
  border-radius: 12px;
  background: var(--profile-bg);
}
.profile-page-wrapper .stat-box {
  padding: 0.7rem;
  transition: transform 180ms var(--profile-spring), border-color 180ms;
}
.profile-page-wrapper .stat-box:hover { transform: translateY(-2px); border-color: var(--profile-green); }
.profile-page-wrapper .stat-box .val {
  display: block;
  color: var(--profile-ink);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.08rem;
  font-weight: 800;
}
.profile-page-wrapper .stat-box .lbl {
  color: var(--profile-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-page-wrapper .card-header,
.profile-page-wrapper .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--profile-ink);
  font-size: 0.98rem;
  font-weight: 800;
}
.profile-page-wrapper .card-header h2 {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.profile-page-wrapper .card-header i { color: var(--profile-green-deep); }
.profile-page-wrapper .edit-btn {
  padding: 0.55rem 0.85rem;
  color: var(--profile-green-deep);
  background: rgba(126, 217, 87, 0.13);
}
.profile-page-wrapper .edit-btn:hover { background: rgba(126, 217, 87, 0.22); }

.profile-page-wrapper .insight-item {
  padding: 0.85rem 0;
  border-top: 1px solid var(--profile-line);
}
.profile-page-wrapper .insight-item:first-of-type { border-top: 0; padding-top: 0; }
.profile-page-wrapper .skill-ring-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.profile-page-wrapper .skill-ring {
  width: 86px;
  height: 86px;
  flex: none;
}
.profile-page-wrapper .ring-track {
  fill: none;
  stroke: var(--profile-line);
  stroke-width: 10;
}
.profile-page-wrapper .ring-progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 900ms var(--profile-ease);
}
.profile-page-wrapper .ring-progress.tier-high { stroke: var(--profile-green-deep); }
.profile-page-wrapper .ring-progress.tier-mid { stroke: var(--profile-gold); }
.profile-page-wrapper .ring-progress.tier-low { stroke: var(--profile-red); }
.profile-page-wrapper .ring-value {
  fill: var(--profile-ink);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.35rem;
  font-weight: 800;
}
.profile-page-wrapper .insight-lbl,
.profile-page-wrapper .label {
  display: block;
  color: var(--profile-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-page-wrapper .insight-val,
.profile-page-wrapper .value {
  color: var(--profile-ink);
  font-size: 0.92rem;
  font-weight: 700;
}
.profile-page-wrapper .insight-highlight { color: var(--profile-green-deep); }
.profile-page-wrapper .consistency-bar {
  height: 8px;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: var(--profile-bg);
  overflow: hidden;
}
.profile-page-wrapper .consistency-fill {
  height: 100%;
  border-radius: inherit;
}
.profile-page-wrapper .consistency-fill.tier-high { background: linear-gradient(90deg, var(--profile-green-deep), var(--profile-green)); }
.profile-page-wrapper .consistency-fill.tier-mid { background: linear-gradient(90deg, #C77E00, var(--profile-gold)); }
.profile-page-wrapper .consistency-fill.tier-low { background: linear-gradient(90deg, #C93A40, var(--profile-red)); }

.profile-page-wrapper .training-grid,
.profile-page-wrapper .history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.profile-page-wrapper .course-mini-card,
.profile-page-wrapper .history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  transition: transform 180ms var(--profile-spring), border-color 180ms, background 180ms;
}
.profile-page-wrapper .course-mini-card:hover,
.profile-page-wrapper .history-item:hover {
  transform: translateX(3px);
  border-color: rgba(126, 217, 87, 0.5);
  background: #FFFFFF;
}
.profile-page-wrapper .course-icon,
.profile-page-wrapper .progress-circle,
.profile-page-wrapper .course-badge-count {
  width: 38px;
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(126, 217, 87, 0.16);
  color: var(--profile-green-deep);
  font-weight: 800;
}
.profile-page-wrapper .course-icon.icon-purple {
  background: var(--profile-gold-soft);
  color: var(--profile-gold);
}
.profile-page-wrapper .course-mini-card h4 {
  margin: 0 0 0.15rem;
  color: var(--profile-ink);
  font-size: 0.86rem;
}
.profile-page-wrapper .course-mini-card p {
  margin: 0;
  color: var(--profile-muted);
  font-size: 0.76rem;
}

.profile-page-wrapper .info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.profile-page-wrapper .info-item {
  min-width: 0;
  padding: 0.85rem;
}
.profile-page-wrapper .info-full { grid-column: 1 / -1; }
.profile-page-wrapper .value,
.profile-page-wrapper .value-body {
  display: block;
  margin-top: 0.35rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.profile-page-wrapper .value-body { color: var(--profile-muted); font-weight: 500; }
.profile-page-wrapper .entry-block + .entry-block {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--profile-line);
}
.profile-page-wrapper .entry-block strong { color: var(--profile-ink); }
.profile-page-wrapper .entry-meta,
.profile-page-wrapper .entry-desc,
.profile-page-wrapper .empty-note {
  color: var(--profile-muted);
  font-size: 0.86rem;
}

.profile-page-wrapper .history-info { flex: 1; min-width: 0; }
.profile-page-wrapper .history-info strong { display: block; color: var(--profile-ink); font-size: 0.9rem; }
.profile-page-wrapper .history-info p { margin: 0.2rem 0 0; color: var(--profile-muted); font-size: 0.78rem; }
.profile-page-wrapper .history-score {
  flex: none;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  font-weight: 800;
}
.profile-page-wrapper .history-score.tier-high { color: var(--profile-green-deep); background: rgba(126, 217, 87, 0.18); }
.profile-page-wrapper .history-score.tier-mid { color: #A96A00; background: var(--profile-gold-soft); }
.profile-page-wrapper .history-score.tier-low { color: #B42318; background: var(--profile-red-soft); }
.profile-page-wrapper .empty-state {
  padding: 2.25rem 1rem;
  text-align: center;
  color: var(--profile-muted);
}
.profile-page-wrapper .empty-state i {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--profile-faint);
  font-size: 2rem;
}

.profile-page-wrapper .modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(17, 17, 17, 0.54);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
.profile-page-wrapper .modal-content {
  width: min(920px, 100%);
  margin: 0 auto;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg, 22px);
  background: var(--profile-card);
  box-shadow: var(--profile-shadow);
  overflow: hidden;
  animation: profile-modal-in 0.34s var(--profile-spring) both;
}
.profile-page-wrapper .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  color: var(--c-white, #FFFFFF);
  background: linear-gradient(135deg, #111111, #1F3428 70%, #4FAE2B 150%);
}
.profile-page-wrapper .modal-header h2 {
  margin: 0;
  color: inherit;
  font-size: 1.2rem;
}
.profile-page-wrapper .modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-white, #FFFFFF);
  font-size: 1.5rem;
}
.profile-page-wrapper .modal-close:hover { background: rgba(255, 255, 255, 0.16); transform: rotate(90deg); }
.profile-page-wrapper .modal form {
  padding: 1.25rem;
}
.profile-page-wrapper .form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.profile-page-wrapper .form-group { margin-bottom: 0.95rem; }
.profile-page-wrapper .form-group label,
.profile-page-wrapper .readonly-label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--profile-ink);
  font-size: 0.82rem;
  font-weight: 800;
}
.profile-page-wrapper input,
.profile-page-wrapper select,
.profile-page-wrapper textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--profile-line);
  border-radius: 11px;
  background: var(--profile-bg);
  color: var(--profile-ink);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--dur-fast, 160ms), background var(--dur-fast, 160ms), box-shadow var(--dur-fast, 160ms);
}
.profile-page-wrapper textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.profile-page-wrapper input:focus,
.profile-page-wrapper select:focus,
.profile-page-wrapper textarea:focus {
  border-color: var(--profile-green-deep);
  background: #FFFFFF;
}
.profile-page-wrapper input[type="file"] {
  padding: 0.62rem;
  cursor: pointer;
}
.profile-page-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--profile-green-deep);
}
.profile-page-wrapper .upload-panel,
.profile-page-wrapper .readonly-panel {
  padding: 1rem;
  margin-bottom: 1rem;
}
.profile-page-wrapper .upload-panel h3,
.profile-page-wrapper .modal-subsection h3 {
  margin: 0 0 0.45rem;
  color: var(--profile-green-deep);
  font-size: 0.98rem;
}
.profile-page-wrapper .upload-hint,
.profile-page-wrapper .visibility-hint {
  display: block;
  color: var(--profile-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.profile-page-wrapper .upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.8rem;
}
.profile-page-wrapper .upload-btn,
.profile-page-wrapper .add-row-btn {
  min-height: 42px;
  padding: 0.7rem 1rem;
  color: var(--profile-green-deep);
  background: rgba(126, 217, 87, 0.14);
}
.profile-page-wrapper .saved-file-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-top: 0.75rem;
}
.profile-page-wrapper .saved-file-card > i { color: #D13438; font-size: 1.3rem; }
.profile-page-wrapper .saved-file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-page-wrapper .saved-file-name {
  color: var(--profile-ink);
  font-size: 0.84rem;
  font-weight: 800;
}
.profile-page-wrapper .saved-file-hint,
.profile-page-wrapper .upload-status {
  color: var(--profile-muted);
  font-size: 0.76rem;
}
.profile-page-wrapper .readonly-value {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.72rem 0.8rem;
  border-radius: 11px;
  background: #FFFFFF;
  color: var(--profile-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.profile-page-wrapper .modal-subsection {
  margin: 1.1rem 0;
  padding: 1rem;
  border: 1.5px solid var(--profile-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(126, 217, 87, 0.08), rgba(255, 255, 255, 0));
}
.profile-page-wrapper .repeater-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 42px;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.profile-page-wrapper .repeater-remove {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1.5px solid #F5C2C2;
  background: var(--profile-red-soft);
  color: #B42318;
}
.profile-page-wrapper .repeater-remove:hover { transform: translateY(-2px); background: #FDECEC; }
.profile-page-wrapper .visibility-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1.5px solid var(--profile-line);
  border-radius: 12px;
  background: var(--profile-bg);
  cursor: pointer;
}
.profile-page-wrapper .visibility-toggle-label span {
  color: var(--profile-ink);
  font-size: 0.9rem;
  font-weight: 700;
}
.profile-page-wrapper .submit-btn {
  width: 100%;
  margin-top: 0.35rem;
}

@keyframes profile-rise {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes profile-modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1080px) {
  .profile-page-wrapper .dashboard-container {
    grid-template-columns: 1fr;
  }
  .profile-page-wrapper .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-page-wrapper .profile-top {
    grid-row: span 2;
  }
}

@media (max-width: 760px) {
  .profile-page-wrapper {
    padding: 0.85rem;
  }
  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-page-wrapper .sidebar,
  .profile-page-wrapper .info-grid,
  .profile-page-wrapper .form-row-2,
  .profile-page-wrapper .upload-row {
    grid-template-columns: 1fr;
  }
  .profile-page-wrapper .repeater-row {
    grid-template-columns: 1fr;
  }
  .profile-page-wrapper .repeater-remove {
    width: 100%;
  }
  .profile-page-wrapper .modal {
    padding: 0.75rem;
  }
  .profile-page-wrapper .modal form {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-page-wrapper *,
  .profile-page-wrapper *::before,
  .profile-page-wrapper *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   ADD-ON: student settings page (student/settings.php)
   Appended-only, scoped settings styling that matches the auth
   portal/profile/dashboard theme and interaction model.
   ============================================================ */
.settings-container {
  --settings-ink: var(--c-dark, #111111);
  --settings-muted: var(--c-ink-60, #6B6B6B);
  --settings-faint: var(--c-ink-40, #9A9E98);
  --settings-bg: var(--c-gray, #F7F8FA);
  --settings-card: var(--c-white, #FFFFFF);
  --settings-line: var(--c-gray-line, #E7EAE6);
  --settings-green: var(--c-green, #7ED957);
  --settings-green-deep: var(--c-green-deep, #4FAE2B);
  --settings-mint: #00C896;
  --settings-gold: #E8A100;
  --settings-gold-soft: #FFF6E5;
  --settings-red: #E5484D;
  --settings-red-soft: #FFF3F3;
  --settings-radius: 14px;
  --settings-shadow: 0 18px 50px rgba(17, 17, 17, 0.08);
  --settings-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --settings-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: calc(100svh - var(--header-h, 72px));
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: var(--grad-mesh, radial-gradient(circle at 12% 8%, rgba(126, 217, 87, 0.14), transparent 32%)), var(--settings-bg);
  color: var(--settings-ink);
  font-family: 'Manrope', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.settings-container * {
  box-sizing: border-box;
}

.settings-sidebar {
  min-width: 0;
}

.settings-nav {
  position: sticky;
  top: calc(var(--header-h, 72px) + 1rem);
  padding: 1rem;
  border: 1.5px solid var(--settings-line);
  border-radius: var(--radius-lg, 22px);
  background:
    linear-gradient(180deg, rgba(126, 217, 87, 0.12), rgba(255, 255, 255, 0) 48%),
    var(--settings-card);
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.05);
}

.settings-nav h2 {
  margin: 0 0 0.9rem;
  color: var(--settings-ink);
  font-size: 1.2rem;
  line-height: 1.15;
}

.settings-nav .nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
  padding: 0.72rem 0.8rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--settings-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast, 160ms) var(--settings-spring), border-color var(--dur-fast, 160ms), background var(--dur-fast, 160ms), color var(--dur-fast, 160ms), box-shadow var(--dur-fast, 160ms);
}

.settings-nav .nav-item i {
  width: 20px;
  color: var(--settings-green-deep);
  text-align: center;
}

.settings-nav .nav-item:hover {
  transform: translateX(3px);
  background: rgba(126, 217, 87, 0.1);
  color: var(--settings-ink);
}

.settings-nav .nav-item.active {
  color: var(--settings-ink);
  border-color: rgba(126, 217, 87, 0.42);
  background: linear-gradient(135deg, rgba(126, 217, 87, 0.22), rgba(0, 200, 150, 0.12));
  box-shadow: 0 10px 24px rgba(79, 174, 43, 0.12);
}

.settings-content {
  min-width: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.settings-panel {
  display: none;
  animation: settings-panel-in 0.34s var(--settings-spring) both;
}

.settings-panel.active {
  display: block;
}

.settings-card,
.sub-banner {
  position: relative;
  border: 1.5px solid var(--settings-line);
  border-radius: var(--radius-lg, 22px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.05);
  overflow: hidden;
  transition: transform 220ms var(--settings-ease), border-color 220ms var(--settings-ease), box-shadow 220ms var(--settings-ease);
}

.settings-card {
  padding: clamp(1.15rem, 2.2vw, 1.75rem);
}

.settings-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--settings-green);
}

.settings-card.card-accent-blue::before { background: var(--settings-mint); }
.settings-card.card-accent-green::before { background: var(--settings-green-deep); }

.settings-card:hover,
.sub-banner:hover {
  transform: translateY(-3px);
  border-color: rgba(126, 217, 87, 0.58);
  box-shadow: var(--settings-shadow);
}

.settings-card .card-title {
  margin: 0;
  color: var(--settings-ink);
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.settings-card .card-subtitle {
  margin: 0.45rem 0 1.35rem;
  max-width: 58ch;
  color: var(--settings-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.settings-container .form-group {
  min-width: 0;
  margin-bottom: 0.95rem;
}

.settings-container .form-group.full-width,
.settings-container .section-divider,
.settings-container .save-btn {
  grid-column: 1 / -1;
}

.settings-container label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--settings-ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-container .input-with-icon {
  position: relative;
}

.settings-container .input-with-icon .profile-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--settings-green-deep);
  transform: translateY(-50%);
  pointer-events: none;
}

.settings-container input,
.settings-container select {
  width: 100%;
  min-height: 44px;
  padding: 0.78rem 0.9rem;
  border: 1.5px solid var(--settings-line);
  border-radius: 12px;
  background: var(--settings-bg);
  color: var(--settings-ink);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color var(--dur-fast, 160ms), background var(--dur-fast, 160ms), box-shadow var(--dur-fast, 160ms);
}

.settings-container .input-with-icon input {
  padding-left: 2.55rem;
}

.settings-container select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--settings-faint) 50%),
    linear-gradient(135deg, var(--settings-faint) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
  cursor: pointer;
}

.settings-container input:focus,
.settings-container select:focus {
  outline: none;
  border-color: var(--settings-green-deep);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(126, 217, 87, 0.16);
}

.settings-container input[readonly] {
  color: var(--settings-muted);
  background: #FFFFFF;
  cursor: default;
}

.settings-container small {
  color: var(--settings-muted) !important;
  line-height: 1.45;
}

.section-divider {
  height: 1px;
  margin: 0.25rem 0 1.1rem;
  background: var(--settings-line);
}

.save-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: 999px;
  color: var(--settings-ink);
  background: linear-gradient(135deg, var(--settings-green), var(--settings-mint));
  box-shadow: 0 14px 30px rgba(79, 174, 43, 0.24);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast, 160ms) var(--settings-spring), box-shadow var(--dur-fast, 160ms), filter var(--dur-fast, 160ms);
}

.save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(79, 174, 43, 0.28);
}

.settings-container button:focus-visible,
.settings-container input:focus-visible,
.settings-container select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(126, 217, 87, 0.2);
}

.sub-banner {
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 2.4vw, 1.8rem);
  color: var(--c-white, #FFFFFF);
  background:
    radial-gradient(70% 90% at 12% 5%, rgba(126, 217, 87, 0.36) 0%, rgba(126, 217, 87, 0) 64%),
    linear-gradient(135deg, #111111 0%, #1F3428 58%, #4FAE2B 140%);
}

.sub-header,
.sub-meta,
.validity-top,
.plan-grid,
.notif-item {
  display: flex;
  align-items: center;
}

.sub-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.38rem 0.8rem;
  border: 1px solid rgba(126, 217, 87, 0.42);
  border-radius: 999px;
  color: var(--settings-green);
  background: rgba(126, 217, 87, 0.14);
  font-size: 0.76rem;
  font-weight: 900;
}

.sub-crown {
  color: var(--settings-gold);
  font-size: 1.5rem;
  filter: drop-shadow(0 6px 12px rgba(232, 161, 0, 0.22));
}

.sub-content h3 {
  margin: 0;
  color: var(--c-white, #FFFFFF);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.sub-meta {
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.sub-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.sub-meta-item i {
  color: var(--settings-green);
}

.sub-meta-item strong {
  color: var(--c-white, #FFFFFF);
}

.plan-details-title {
  margin: 0 0 1rem;
  color: var(--settings-ink);
  font-size: 1.05rem;
}

.validity-block {
  padding: 1rem;
  border: 1.5px solid var(--settings-line);
  border-radius: var(--settings-radius);
  background: var(--settings-bg);
}

.validity-top {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.validity-label,
.plan-stat-label {
  color: var(--settings-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.validity-days {
  color: var(--settings-green-deep);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.1rem;
  font-weight: 900;
}

.validity-days small {
  color: var(--settings-muted) !important;
  font-family: inherit;
  font-size: 0.72rem;
}

.validity-bar {
  height: 10px;
  border-radius: 999px;
  background: #FFFFFF;
  overflow: hidden;
}

.validity-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 900ms var(--settings-ease);
}

.validity-bar-fill.bar-ok { background: linear-gradient(90deg, var(--settings-green-deep), var(--settings-green)); }
.validity-bar-fill.bar-urgent { background: linear-gradient(90deg, #C93A40, var(--settings-red)); }

.plan-grid {
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.plan-stat {
  flex: 1;
  min-width: 0;
  padding: 0.9rem;
  border: 1.5px solid var(--settings-line);
  border-radius: 13px;
  background: var(--settings-bg);
  transition: transform 180ms var(--settings-spring), border-color 180ms, background 180ms;
}

.plan-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 217, 87, 0.5);
  background: #FFFFFF;
}

.plan-stat-value {
  display: block;
  margin-top: 0.35rem;
  color: var(--settings-ink);
  font-size: 0.95rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.notif-item {
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1.5px solid var(--settings-line);
  border-radius: var(--settings-radius);
  background: var(--settings-bg);
  transition: transform 180ms var(--settings-spring), border-color 180ms, background 180ms;
}

.notif-item + .notif-item {
  margin-top: 0.75rem;
}

.notif-item:hover {
  transform: translateX(3px);
  border-color: rgba(126, 217, 87, 0.5);
  background: #FFFFFF;
}

.notif-info h4 {
  margin: 0;
  color: var(--settings-ink);
  font-size: 0.95rem;
}

.notif-info p {
  margin: 0.3rem 0 0;
  color: var(--settings-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.switch {
  position: relative;
  flex: none;
  width: 50px;
  height: 28px;
  margin: 0;
}

.switch input {
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--settings-line);
  border-radius: 999px;
  background: #E9ECE8;
  cursor: pointer;
  transition: background var(--dur-fast, 160ms), border-color var(--dur-fast, 160ms);
}

.slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 3px 10px rgba(17, 17, 17, 0.16);
  transform: translateY(-50%);
  transition: transform var(--dur-fast, 160ms) var(--settings-spring);
}

.switch input:checked + .slider {
  border-color: rgba(126, 217, 87, 0.5);
  background: linear-gradient(135deg, var(--settings-green-deep), var(--settings-green));
}

.switch input:checked + .slider::before {
  transform: translate(21px, -50%);
}

.switch input:disabled + .slider {
  cursor: not-allowed;
  opacity: 0.72;
}

@keyframes settings-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .settings-container {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    position: static;
  }
  .settings-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .settings-nav h2 {
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
  }
  .settings-nav .nav-item {
    margin-bottom: 0;
  }
}

@media (max-width: 700px) {
  .settings-container {
    padding: 0.85rem;
  }
  .settings-nav,
  .settings-form-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }
  .settings-form-grid,
  .plan-grid {
    display: grid;
  }
  .notif-item {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-container *,
  .settings-container *::before,
  .settings-container *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   TUNING: student settings profile/account fit
   Append-only density pass for the first settings panel.
   ============================================================ */
.settings-container {
  gap: 0.75rem;
  padding: clamp(0.65rem, 1.25vw, 1rem);
}

.settings-nav {
  padding: 0.75rem;
}

.settings-nav h2 {
  margin-bottom: 0.55rem;
  font-size: 1.05rem;
}

.settings-nav .nav-item {
  min-height: 38px;
  margin-bottom: 0.32rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 10px;
}

.settings-content {
  padding-right: 0;
}

.settings-card {
  padding: clamp(0.85rem, 1.45vw, 1.15rem);
  border-radius: 16px;
}

.settings-card .card-title {
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

.settings-card .card-subtitle {
  margin: 0.25rem 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.settings-form-grid {
  gap: 0.55rem 0.75rem;
}

.settings-container .form-group {
  margin-bottom: 0.55rem;
}

.settings-container label {
  margin-bottom: 0.22rem;
  font-size: 0.76rem;
}

.settings-container input,
.settings-container select {
  min-height: 36px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 10px;
  font-size: 0.84rem;
}

.settings-container .input-with-icon input {
  padding-left: 2.35rem;
}

.settings-container .input-with-icon .profile-icon {
  left: 0.78rem;
}

.settings-container small {
  margin-top: 3px !important;
  font-size: 0.68rem !important;
}

.section-divider {
  margin: 0 0 0.65rem;
}

.save-btn {
  min-height: 40px;
  padding: 0.68rem 1rem;
  font-size: 0.86rem;
}

#panel-profile .settings-card {
  max-height: calc(100svh - var(--header-h, 72px) - 1.5rem);
  overflow-y: auto;
}

#panel-profile .settings-card form {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 981px) {
  .settings-container {
    grid-template-columns: minmax(210px, 245px) minmax(0, 1fr);
  }

  #panel-profile .settings-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #panel-profile .form-group.full-width {
    grid-column: span 1;
  }

  #panel-profile .section-divider,
  #panel-profile .save-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .settings-container {
    padding: 0.65rem;
  }

  .settings-card {
    padding: 0.8rem;
  }

  #panel-profile .settings-card {
    max-height: none;
  }
}

/* ============================================================
   ADD-ON: locked specialization field (student_registerv2v2.php)
   Shown when the selected qualification (8th/9th/10th) has no
   specialization concept. Hides the select/input shell entirely
   instead of letting it collapse, and renders the hint text as a
   proper disabled-field placeholder that fills the same space.
   ============================================================ */
#specialization_field.is-locked .auth-input-wrap {
  display: none !important;
}

#specialization_field.is-locked .auth-field-hint {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--c-gray-line);
  background: var(--c-gray);
  color: var(--c-ink-40);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: not-allowed;
}

#specialization_field.is-locked .auth-field-hint::before {
  content: '';
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 10V8a6 6 0 1 1 12 0v2h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h1zm2 0h8V8a4 4 0 1 0-8 0v2zm4 4a1.5 1.5 0 0 0-1 2.62V18a1 1 0 1 0 2 0v-1.38A1.5 1.5 0 0 0 12 14z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 10V8a6 6 0 1 1 12 0v2h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h1zm2 0h8V8a4 4 0 1 0-8 0v2zm4 4a1.5 1.5 0 0 0-1 2.62V18a1 1 0 1 0 2 0v-1.38A1.5 1.5 0 0 0 12 14z'/%3E%3C/svg%3E") no-repeat center / contain;
}