/* e-CSDFE shared interface foundation. Kept framework-free so legacy PHP pages retain their workflows. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --sidebar: #0d1b2a;
  --sidebar-hover: #172b42;
  --primary: #1267d6;
  --primary-hover: #0c55b4;
  --accent: #0f9f8b;
  --text: #142033;
  --text-muted: #607087;
  --border: #dbe4ef;
  --focus: #f59e0b;
  --success: #087f5b;
  --warning: #a85f00;
  --danger: #c43535;
  --info: #1267d6;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%), 0 2px 8px rgb(15 23 42 / 4%);
  --shadow-md: 0 10px 28px rgb(15 23 42 / 8%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #121c2c;
  --surface-raised: #182538;
  --sidebar: #09111d;
  --sidebar-hover: #14243a;
  --primary: #5aa2ff;
  --primary-hover: #8abaff;
  --accent: #39c6ad;
  --text: #e7edf5;
  --text-muted: #aab8ca;
  --border: #283a51;
  --success: #46d39b;
  --warning: #f3b24d;
  --danger: #ff8383;
  --info: #7bb5ff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 24%);
  --shadow-md: 0 10px 28px rgb(0 0 0 / 28%);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { min-height: 100%; color: var(--text) !important; background: var(--bg) !important; font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); z-index: 2001; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, input[type="submit"], input[type="button"] { min-height: 42px; border-radius: var(--radius-sm) !important; transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
button:hover, input[type="submit"]:hover, input[type="button"]:hover { transform: translateY(-1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent); outline-offset: 2px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 44px; color: var(--text) !important; background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; box-shadow: none !important; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent) !important; }
label { color: var(--text) !important; }

/* Shared authenticated shell — compatible with existing repeated markup. */
.top-bar { background: var(--surface-raised) !important; border-bottom: 1px solid var(--border); color: var(--text) !important; box-shadow: var(--shadow-sm); }
.top-bar .center { color: var(--text) !important; letter-spacing: -.01em; }
.hamburger { color: var(--text) !important; min-width: 44px; min-height: 44px; display: inline-grid !important; place-items: center; border-radius: var(--radius-sm); background: none;
  border: 0;
  cursor: pointer;
  font-size: 18px; }
.hamburger:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.sidebar { background: var(--sidebar) !important; border-right: 1px solid color-mix(in srgb, #fff 9%, transparent); }
.sidebar h2 { color: #f8fbff !important; font-weight: 700; letter-spacing: -.02em; }
.sidebar a { color: #c6d4e5 !important; border-radius: var(--radius-sm) !important; margin: 3px 0 !important; min-height: 40px; display: flex !important; align-items: center; }
.sidebar a:hover, .sidebar a:focus-visible { color: #fff !important; background: var(--sidebar-hover) !important; }
.sidebar .nav-section { border-color: color-mix(in srgb, #fff 12%, transparent) !important; }
.sidebar .nav-section-title { color: #8fa6bf !important; font-size: 11px !important; font-weight: 700; letter-spacing: .08em; }
.main-content { color: var(--text) !important; background: var(--bg) !important; }
.dropdown { background: var(--surface-raised) !important; border-color: var(--border) !important; box-shadow: var(--shadow-md); overflow: hidden; display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  z-index: 1400; }
.dropdown a { color: var(--text) !important; display: block;
  padding: 10px 14px;
  white-space: nowrap; }
.dropdown a:hover { background: color-mix(in srgb, var(--primary) 9%, var(--surface)) !important; }
.avatar { background: var(--primary) !important; color: #fff !important; border: 2px solid color-mix(in srgb, var(--primary) 25%, var(--surface)); width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  font-weight: 700; }
.avatar-image { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* Cards, data and messages across legacy screens. */
.card, .course-card, .course-info, .materials, .profile-box, .form-container, .container, .content-box, .table-container, .stat-card, .assignment-card, .group-card, .staff-card, .box { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-sm) !important; }
.course-card, .section-box { border: 1px solid var(--border) !important; background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow-sm) !important; }
.course-card:hover, .section-box:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)) !important; box-shadow: var(--shadow-md) !important; }
.section-box { border-radius: var(--radius-md) !important; }
.page-header, .content-header { margin-bottom: 24px; }
h1, h2, h3, h4 { color: var(--text) !important; letter-spacing: -.02em; }
p, .subtitle, .description, .muted, small { color: var(--text-muted); }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
th { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); color: var(--text) !important; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
th, td { padding: 13px 16px !important; border-bottom: 1px solid var(--border) !important; text-align: left; }
tr:last-child td { border-bottom: 0 !important; }
tr:hover td { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.success, .alert-success { color: var(--success) !important; border-color: color-mix(in srgb, var(--success) 35%, var(--border)) !important; background: color-mix(in srgb, var(--success) 10%, var(--surface)) !important; }
.error, .alert-error, .danger { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 35%, var(--border)) !important; background: color-mix(in srgb, var(--danger) 9%, var(--surface)) !important; }
.warning { color: var(--warning) !important; }
.empty-state { border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text-muted); padding: 32px 20px; text-align: center; }

.theme-toggle { position: fixed; right: 20px; bottom: 20px; z-index: 2000; width: 46px; height: 46px; min-height: 46px; border: 1px solid var(--border); border-radius: 50% !important; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow-md); cursor: pointer; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 3000; padding: 10px 14px; color: #fff; background: var(--primary); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

@media (max-width: 768px) {
  body { font-size: 15px; }
  .top-bar { padding: 8px 14px !important; min-height: 60px; }
  .top-bar .center { font-size: .88rem !important; }
  .sidebar { width: min(284px, 86vw) !important; top: 60px !important; height: calc(100dvh - 60px) !important; box-shadow: var(--shadow-md); transition: transform .2s ease; }
  .main-content { width: 100% !important; margin-left: 0 !important; padding: 82px 16px 32px !important; height: auto !important; min-height: 100dvh; }
  /* Supports both existing sidebar toggle implementations. */
  .sidebar.hidden, .sidebar-hidden .sidebar { display: block !important; transform: translateX(-100%); }
  .sidebar-hidden .main-content { margin-left: 0 !important; }
  .profile-box, .form-container, .container, .box { padding: 22px !important; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  th, td { padding: 11px 12px !important; }
  .section-links { gap: 12px !important; }
  .section-box { max-width: none !important; min-width: min(100%, 220px) !important; }
  .theme-toggle { right: 14px; bottom: 14px; }
}

/* Carry-over registration and review workspace. */
.carryover-page { overflow-x: clip; }
.carryover-page::after { content:""; position:fixed; inset:68px 0 0 264px; z-index:-1; pointer-events:none; background:radial-gradient(circle at 85% 4%,color-mix(in srgb,var(--primary) 10%,transparent),transparent 30%),radial-gradient(circle at 12% 20%,color-mix(in srgb,var(--accent) 8%,transparent),transparent 24%); }
.carryover-page .top-bar { position:fixed; inset:0 0 auto; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; min-height:68px; padding:10px 28px !important; background:color-mix(in srgb,var(--surface-raised) 92%,transparent) !important; backdrop-filter:blur(16px); z-index:1300; }
.carryover-page .top-bar .left,.carryover-page .top-bar .center,.carryover-page .top-bar .right { display:flex; align-items:center; }.carryover-page .top-bar .left{gap:12px;color:var(--text-muted);font-size:.875rem}.carryover-page .top-bar .center{justify-content:center;font-size:1rem;font-weight:700}.carryover-page .top-bar .right{justify-content:flex-end;position:relative}
.carryover-page .hamburger{margin:0;cursor:pointer;font-size:18px}.carryover-page .sidebar{position:fixed;top:68px;left:0;width:264px;height:calc(100dvh - 68px);padding:22px 14px;overflow-y:auto;z-index:1200}.carryover-page .sidebar h2{margin:0 10px 20px;font-size:1.125rem}.carryover-page .sidebar a{gap:10px;margin:2px 0 !important;padding:9px 10px;font-size:.875rem}.carryover-page .sidebar a i{width:18px;margin:0;text-align:center}.carryover-page .sidebar a[aria-current="page"]{color:#fff !important;background:color-mix(in srgb,var(--primary) 74%,var(--sidebar)) !important;box-shadow:inset 3px 0 0 var(--accent)}.carryover-page .sidebar .nav-section{margin-top:18px;padding-top:14px}.carryover-page .sidebar .nav-section-title{padding:0 10px 7px}
.carryover-page .main-content{width:calc(100% - 264px);min-height:calc(100dvh - 68px);margin:68px 0 0 264px;padding:32px;transition:margin .2s ease,width .2s ease}.carryover-layout{max-width:1180px;margin:0 auto}.carryover-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:32px;margin-bottom:24px;color:#fff;background:linear-gradient(118deg,#0e4ca3 0%,var(--primary) 58%,var(--accent) 160%);border-radius:var(--radius-lg);box-shadow:var(--shadow-md)}.carryover-hero h1{margin:0;color:#fff !important;font-size:clamp(1.5rem,2.5vw,2rem);line-height:1.25}.carryover-hero p:not(.dashboard-kicker){margin:10px 0 0;max-width:670px;color:rgb(255 255 255 / 86%) !important}.carryover-hero .dashboard-kicker{margin:0 0 8px;color:rgb(255 255 255 / 72%) !important}.carryover-hero-icon{display:grid;place-items:center;flex:0 0 auto;width:58px;height:58px;border:1px solid rgb(255 255 255 / 20%);border-radius:16px;background:rgb(255 255 255 / 12%);font-size:1.5rem}
.carryover-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(270px,.85fr);gap:18px;margin-bottom:18px}.carryover-card{padding:24px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}.card-heading,.status-heading{display:flex;align-items:flex-start;gap:13px}.card-heading h2,.status-heading h2{margin:0;color:var(--text);font-size:1.125rem}.card-heading p,.status-heading p{margin:4px 0 0;font-size:.8125rem}.card-icon{display:grid;place-items:center;flex:0 0 auto;width:40px;height:40px;color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,var(--surface));border-radius:10px}.card-icon.accent{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--surface))}.card-icon.neutral{color:#64748b;background:#f1f5f9}.carryover-form{display:grid;gap:8px;margin-top:24px}.carryover-form label{margin-top:8px;font-size:.8125rem;font-weight:700}.readonly-field{min-height:44px;padding:11px 12px;color:var(--text-muted);background:color-mix(in srgb,var(--text-muted) 6%,var(--surface));border:1px solid var(--border);border-radius:var(--radius-sm);font-size:.875rem}.carryover-primary,.confirm-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;color:#fff;background:var(--primary);font-size:.875rem;font-weight:700;cursor:pointer}.carryover-primary{width:100%;margin-top:16px}.carryover-primary:hover,.confirm-button:hover{color:#fff;background:var(--primary-hover)}button:disabled{cursor:not-allowed;opacity:.55;transform:none !important}.process-card{background:linear-gradient(155deg,color-mix(in srgb,var(--accent) 7%,var(--surface)),var(--surface) 58%)}.process-list{display:grid;gap:20px;margin:26px 0 0;padding:0;list-style:none}.process-list li{display:flex;gap:12px;align-items:flex-start}.process-list li>span{display:grid;place-items:center;flex:0 0 auto;width:25px;height:25px;color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,var(--surface));border-radius:50%;font-size:.75rem;font-weight:800}.process-list strong{font-size:.875rem}.process-list p{margin:2px 0 0;font-size:.78rem}.status-card{margin-top:18px}.status-heading{justify-content:space-between;margin-bottom:20px}.status-count{display:grid;place-items:center;width:36px;height:36px;color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,var(--surface));border-radius:50%;font-size:.875rem;font-weight:800}.table-wrap{overflow-x:auto}.status-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;font-size:.75rem;font-weight:700}.status-pending{color:#a85f00;background:#fff7e6}.status-confirmed{color:#087f5b;background:#eafaf4}.empty-state i{display:block;margin-bottom:12px;color:var(--primary);font-size:1.75rem}.empty-state h2{margin:0 0 5px;font-size:1.05rem}.empty-state p{margin:0;font-size:.875rem}
.carryover-notice{display:flex;align-items:center;gap:9px;margin-bottom:18px;padding:12px 14px;border:1px solid;border-radius:var(--radius-sm);font-size:.875rem;font-weight:600}.carryover-notice-success{color:#166534;background:#f0fdf4;border-color:#bbf7d0}.carryover-notice-error{color:#b91c1c;background:#fef2f2;border-color:#fecaca}.review-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}.review-stats article{display:flex;align-items:center;gap:12px;padding:18px 20px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm)}.review-stats strong{display:block;color:var(--text);font-size:1.45rem;line-height:1}.review-stats p{margin:5px 0 0;font-size:.78rem}.confirm-button{min-height:36px;padding:7px 10px;border-radius:7px !important;white-space:nowrap}.reviewed-text{color:var(--text-muted);font-size:.75rem;white-space:nowrap}
@media (min-width:769px){.carryover-page.nav-collapsed .sidebar{transform:translateX(-105%)!important}.carryover-page.nav-collapsed .main-content{width:100%;margin-left:0}}
@media (max-width:768px){.carryover-page .top-bar{min-height:60px;padding:8px 16px !important}.carryover-page .top-bar .left{flex:0 0 auto}.carryover-page .top-bar .center{justify-content:flex-start;font-size:.875rem}.carryover-page .top-bar .right{flex:0 0 auto}.carryover-page .sidebar{top:60px;height:calc(100dvh - 60px);transform:translateX(-105%);transition:transform .2s ease}.carryover-page .sidebar.show{transform:translateX(0)}.carryover-page .nav-backdrop{position:fixed;inset:60px 0 0;z-index:1100;background:rgb(9 17 29 / 44%)}.carryover-page .nav-backdrop.is-visible{display:block}.carryover-page .main-content{width:100%;min-height:100dvh;margin:0;padding:84px 16px 32px}.carryover-page::after{inset:60px 0 0}.carryover-hero{display:grid;padding:24px}.carryover-hero-icon{display:none}.carryover-grid,.review-stats{grid-template-columns:1fr}.carryover-card{padding:20px}.carryover-page table{display:table;min-width:650px;white-space:normal}.status-card{overflow:hidden}}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Dashboard and navigation pattern. Legacy rules load first; these preserve
   existing PHP flows while applying the shared visual system. */
.dashboard-page { overflow-x: clip; }
.dashboard-page .top-bar { position: fixed; inset: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%; min-height: 68px; padding: 10px 28px !important; background: color-mix(in srgb, var(--surface-raised) 92%, transparent) !important; backdrop-filter: blur(16px); z-index: 1300; }
.dashboard-page .top-bar .left, .dashboard-page .top-bar .center, .dashboard-page .top-bar .right { display: flex; align-items: center; }
.dashboard-page .top-bar .center { justify-content: center; }
.dashboard-page .top-bar .right { justify-content: flex-end; position: relative; }
.dashboard-page .top-bar .left, .dashboard-page .top-bar .right { gap: 12px; font-size: .875rem; color: var(--text-muted); }
.dashboard-page .top-bar .left > i { color: var(--primary); }
.dashboard-page .top-bar .center { font-size: 1rem; font-weight: 700; }
.dashboard-page .hamburger { cursor: pointer; margin: 0; font-size: 18px; }
.dashboard-page .sidebar { position: fixed; top: 68px; left: 0; width: 264px; height: calc(100dvh - 68px); padding: 22px 14px; overflow-y: auto; scrollbar-width: thin; transition: transform .2s ease; z-index: 1200; }
.dashboard-page .sidebar h2 { margin: 0 10px 20px; font-size: 1.125rem; }
.dashboard-page .sidebar a { gap: 10px; margin: 2px 0 !important; padding: 9px 10px; font-size: .875rem; }
.dashboard-page .sidebar a i { width: 18px; margin: 0; text-align: center; }
.dashboard-page .sidebar a[aria-current="page"] { color: #fff !important; background: color-mix(in srgb, var(--primary) 74%, var(--sidebar)) !important; box-shadow: inset 3px 0 0 var(--accent); }
.dashboard-page .sidebar .nav-section { margin-top: 18px; padding-top: 14px; }
.dashboard-page .sidebar .nav-section-title { padding: 0 10px 7px; }
.dashboard-page .main-content { width: calc(100% - 264px); min-height: calc(100dvh - 68px); margin: 68px 0 0 264px; padding: 32px; transition: margin .2s ease, width .2s ease; }
.dashboard-page .dashboard-box { max-width: 1440px; margin: 0 auto; padding: 0; background: transparent !important; border: 0 !important; box-shadow: none !important; }
.dashboard-page .dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; margin-bottom: 32px; background: linear-gradient(118deg, #0e4ca3 0%, var(--primary) 58%, var(--accent) 160%); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.dashboard-page .dashboard-kicker { margin: 0 0 8px; color: rgb(255 255 255 / 72%) !important; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dashboard-page .dashboard-hero h1 { margin: 0; color: #fff !important; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; }
.dashboard-page .dashboard-hero > div > p:not(.dashboard-kicker) { margin: 10px 0 0; color: rgb(255 255 255 / 86%) !important; max-width: 680px; }
.dashboard-page .hero-action { flex: 0 0 auto; background: #fff !important; color: #0e4ca3 !important; }
.dashboard-page .hero-action:hover { background: #eff6ff !important; color: #0e4ca3 !important; }
.dashboard-page .registration-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px !important; padding: 7px 10px; border: 1px solid rgb(255 255 255 / 26%); border-radius: 999px; color: #fff !important; background: rgb(255 255 255 / 10%); font-size: .8125rem; }
.dashboard-page .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 36px; }
.dashboard-page .stat-card { position: relative; padding: 20px; overflow: hidden; text-align: left; border-left: 0 !important; }
.dashboard-page .stat-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); }
.dashboard-page .stat-icon { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 0 18px; border-radius: 10px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-size: 1.1rem; }
.dashboard-page .stat-number { color: var(--text); font-size: 1.875rem; line-height: 1.1; }
.dashboard-page .stat-label { margin-top: 6px; color: var(--text-muted); font-size: .875rem; }
.dashboard-page .section-header { margin: 36px 0 16px; padding: 0; border: 0; }
.dashboard-page .section-header p { margin: 4px 0 0; font-size: .875rem; }
.dashboard-page .section-header h3 { gap: 10px; font-size: 1.125rem; }
.dashboard-page .section-header h3 i { color: var(--primary); }
.dashboard-page .actions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 36px; }
.dashboard-page .action-card { padding: 20px; background: var(--surface) !important; border: 1px solid var(--border); border-radius: var(--radius-md); }
.dashboard-page .action-card:hover { border-color: color-mix(in srgb, var(--primary) 46%, var(--border)); box-shadow: var(--shadow-md); }
.dashboard-page .action-icon { width: 42px; height: 42px; margin-bottom: 16px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.dashboard-page .action-icon i { font-size: 1.125rem; color: var(--primary); }
.dashboard-page .action-card h4, .dashboard-page .course-card h4 { color: var(--text) !important; }
.dashboard-page .action-card p { margin-bottom: 16px; color: var(--text-muted) !important; font-size: .875rem; }
.dashboard-page .action-buttons { gap: 8px; }
.dashboard-page .btn-sm, .dashboard-page .course-link { min-height: 36px; padding: 7px 11px; border-radius: 7px; background: var(--primary) !important; color: #fff !important; font-size: .8125rem; font-weight: 600; }
.dashboard-page .btn-sm:hover, .dashboard-page .course-link:hover { background: var(--primary-hover) !important; color: #fff !important; }
.dashboard-page .course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dashboard-page .semester-heading { display: flex; align-items: center; gap: 8px; margin: 24px 0 12px; color: var(--text) !important; font-size: .9375rem; }
.dashboard-page .semester-heading i { color: var(--primary); }
.dashboard-page .course-card { padding: 22px 20px; text-align: left; text-decoration: none; }
.dashboard-page .course-card:hover { transform: translateY(-2px); }
.dashboard-page .course-badge { top: 16px; right: 16px; padding: 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.dashboard-page .course-icon { margin-bottom: 16px; color: var(--primary); font-size: 2rem; }
.dashboard-page .course-link { margin-top: 16px; }
.dashboard-page .delete-btn { min-height: 36px; border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border)); border-radius: 7px; }
.dashboard-page .delete-btn:hover { background: var(--danger); }
.dashboard-page .empty-state { padding: 48px 24px; }
.dashboard-page .empty-state-action { display: inline-flex; margin-top: 16px; }
.dashboard-page .empty-state-note { margin-top: 6px; font-size: .8125rem; }
.nav-backdrop { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Curriculum library */
.curriculum-page .curriculum-box { max-width: 1120px; margin: 0 auto; background: var(--surface) !important; color: var(--text) !important; }
.curriculum-page .breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text-muted); font-size: .8125rem; }
.curriculum-page .breadcrumb i { font-size: .625rem; color: var(--text-muted); }
.curriculum-page .breadcrumb span { color: var(--text); }
.curriculum-page .curriculum-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; margin-bottom: 24px; color: #fff; background: linear-gradient(118deg, #0e4ca3 0%, var(--primary) 58%, var(--accent) 160%); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.curriculum-page .curriculum-hero h1 { margin: 0; color: #fff !important; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; }
.curriculum-page .curriculum-hero > div > p:not(.dashboard-kicker) { margin: 10px 0 0; max-width: 620px; color: rgb(255 255 255 / 86%) !important; }
.curriculum-page .curriculum-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 16px; }
.curriculum-page .curriculum-toolbar p { margin: 0; color: var(--text-muted); font-size: .875rem; }
.curriculum-page .curriculum-search-status { margin-top: 5px; font-size: .75rem; }
.curriculum-page .curriculum-search-status i { margin-right: 5px; color: var(--primary); }
.curriculum-page .search-spinner { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 2px solid color-mix(in srgb, var(--primary) 24%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: curriculum-search-spin .75s linear infinite; }
@keyframes curriculum-search-spin { to { transform: rotate(360deg); } }
.curriculum-page .curriculum-toolbar strong { color: var(--text); font-size: 1rem; }
.curriculum-page .curriculum-search { display: flex; align-items: center; gap: 10px; width: min(100%, 340px); padding: 0 12px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.curriculum-page .curriculum-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.curriculum-page .curriculum-search input { min-height: 42px; padding: 0; border: 0 !important; box-shadow: none !important; }
.curriculum-page .file-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.curriculum-page .file-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px; margin: 0; background: var(--surface) !important; border: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: var(--radius-md); }
.curriculum-page .file-item { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.curriculum-page .file-item:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 46%, var(--border)); box-shadow: var(--shadow-md); }
.curriculum-page .file-item.is-pinned { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 45%) !important; }
.curriculum-page .file-item.is-pinned .file-icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.curriculum-page .file-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-radius: 10px; font-size: 1.25rem; }
.curriculum-page .file-info { min-width: 0; }
.curriculum-page .file-info > a { display: block; overflow: hidden; color: var(--text) !important; font-size: .9375rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.curriculum-page .file-info > a:hover { color: var(--primary) !important; }
.curriculum-page .file-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--text-muted); font-size: .75rem; }
.curriculum-page .file-meta span { display: inline-flex; align-items: center; gap: 5px; }
.curriculum-page .file-type { padding: 2px 7px; color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); border-radius: 999px; font-size: .6875rem; font-weight: 700; text-transform: uppercase; }
.curriculum-page .file-actions { display: flex; align-items: center; gap: 8px; }
.curriculum-page .file-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 11px; color: #fff !important; background: var(--primary); border-radius: 7px; font-size: .8125rem; font-weight: 600; text-decoration: none; }
.curriculum-page .file-action:hover { color: #fff !important; background: var(--primary-hover); }
.curriculum-page .file-action-secondary { color: var(--text) !important; background: var(--surface); border: 1px solid var(--border); }
.curriculum-page .file-action-secondary:hover { color: var(--primary) !important; background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.curriculum-page .file-action-icon { color: var(--text) !important; background: var(--surface); border: 1px solid var(--border); }
.curriculum-page .file-action-icon:hover, .curriculum-page .is-pinned .file-action-icon { color: var(--accent) !important; border-color: color-mix(in srgb, var(--accent) 44%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.curriculum-page .delete-document-form { display: contents; }
.curriculum-page .file-action-danger { color: #b91c1c !important; background: #fff; border: 1px solid #fecaca; }
.curriculum-page .file-action-danger:hover { color: #fff !important; background: #dc2626; border-color: #dc2626; }
.curriculum-page .curriculum-notice { margin: -8px 0 18px; padding: 11px 13px; border: 1px solid; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; }
.curriculum-page .curriculum-notice-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.curriculum-page .curriculum-notice-error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.curriculum-page .curriculum-upload-layer { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(9 17 29 / 58%); backdrop-filter: blur(3px); z-index: 3000; }
.curriculum-page .curriculum-upload-layer[hidden] { display: none; }
.curriculum-page .curriculum-upload-dialog { width: min(520px, 100%); overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgb(15 23 42 / 24%); }
.curriculum-page .curriculum-upload-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--border); }
.curriculum-page .curriculum-upload-header .dashboard-kicker { margin-bottom: 5px; color: var(--primary); }
.curriculum-page .curriculum-upload-header h2 { margin: 0; color: var(--text) !important; font-size: 1.2rem; }
.curriculum-page .curriculum-upload-form { display: grid; gap: 10px; padding: 20px; }
.curriculum-page .curriculum-upload-form label { color: var(--text); font-size: .875rem; font-weight: 700; }
.curriculum-page .curriculum-upload-form input[type="file"] { width: 100%; padding: 11px; color: var(--text); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.curriculum-page .curriculum-upload-form p { margin: 0; color: var(--text-muted); font-size: .78rem; }
.curriculum-page .curriculum-upload-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.curriculum-page .document-preview-layer { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(9 17 29 / 58%); backdrop-filter: blur(3px); z-index: 3000; }
.curriculum-page .document-preview-layer[hidden] { display: none; }
.curriculum-page .document-preview { width: min(1180px, 88vw); max-width: none; max-height: 88dvh; overflow: hidden; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 24px 64px rgb(15 23 42 / 24%); }
.curriculum-page .document-preview-header, .curriculum-page .document-preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.curriculum-page .document-preview-header { border-bottom: 1px solid var(--border); }
.curriculum-page .document-preview-header h2 { max-width: calc(100% - 44px); margin: 0; overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.curriculum-page .preview-close { display: grid; place-items: center; flex: 0 0 auto; width: 38px; min-height: 38px; padding: 0; color: var(--text-muted); background: transparent; border: 0; }
.curriculum-page .preview-close:hover { color: var(--text); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.curriculum-page .document-preview-body { height: min(75dvh, 800px); background: color-mix(in srgb, var(--text) 5%, var(--surface)); }
.curriculum-page .document-preview iframe { display: block; width: 100%; height: 100%; border: 0; }
.curriculum-page .document-preview-footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.curriculum-page .empty-state h2 { margin: 4px 0 8px; color: var(--text) !important; font-size: 1.125rem; }


@media (min-width: 769px) {
  .dashboard-page.nav-collapsed .sidebar { transform: translateX(-105%) !important; }
  .dashboard-page.nav-collapsed .main-content { width: 100%; margin-left: 0; }
}

@media (max-width: 1180px) and (min-width: 769px) {
  .dashboard-page .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page .actions-grid, .dashboard-page .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .dashboard-page .top-bar { min-height: 60px; padding: 8px 16px !important; }
  .dashboard-page .top-bar .left { flex: 0 0 auto; }
  .dashboard-page .top-bar .center { justify-content: flex-start; font-size: .875rem; }
  .dashboard-page .top-bar .right { flex: 0 0 auto; }
  .dashboard-page .sidebar { top: 60px; height: calc(100dvh - 60px); transform: translateX(-105%); z-index: 1200; }
  .dashboard-page .sidebar.show { transform: translateX(0); }
  .dashboard-page .nav-backdrop { position: fixed; inset: 60px 0 0; z-index: 1100; background: rgb(9 17 29 / 44%); }
  .dashboard-page .nav-backdrop.is-visible { display: block; }
  .dashboard-page .main-content { width: 100%; min-height: 100dvh; margin: 0; padding: 84px 16px 32px; }
  .dashboard-page .dashboard-hero { display: grid; padding: 24px; margin-bottom: 24px; }
  .dashboard-page .hero-action { justify-content: center; }
  .dashboard-page .stats-grid, .dashboard-page .actions-grid, .dashboard-page .course-grid { grid-template-columns: 1fr; }
  .dashboard-page .section-header { margin-top: 28px; }
  .curriculum-page .curriculum-hero { display: grid; padding: 24px; }
  .curriculum-page .curriculum-toolbar { align-items: stretch; flex-direction: column; }
  .curriculum-page .curriculum-search { width: 100%; }
  .curriculum-page .file-item { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .curriculum-page .file-icon { width: 40px; height: 40px; }
  .curriculum-page .file-actions { grid-column: 1 / -1; }
  .curriculum-page .file-action { flex: 1; }
  .curriculum-page .file-action-icon { flex: 0 0 auto; }
  .curriculum-page .file-action-icon span { display: none; }
  .curriculum-page .document-preview-layer { padding: 10px; }
  .curriculum-page .document-preview { width: 100%; }
  .curriculum-page .document-preview-header, .curriculum-page .document-preview-footer { padding: 12px; }
  .curriculum-page .document-preview-body { height: 68dvh; }
  .curriculum-page .document-preview-footer { flex-wrap: wrap; }
}

/* Timetable */
.timetable-box { max-width: 1120px; margin: 0 auto; background: var(--surface) !important; color: var(--text) !important; }

/* Staff Directory */
.staff-box { max-width: 1120px; margin: 0 auto; background: var(--surface) !important; color: var(--text) !important; } 

/* Register Course Page */
.course-form-box { max-width: 1120px; margin: 0 auto; background: var(--surface) !important; color: var(--text) !important; }

/* ============================================================
   AUTH PAGES (register.php / login.php)
   Append this block to the end of assets/app.css — it replaces any
   previous .auth-* block you may have added.
   Reuses existing tokens: --primary, --accent, --surface, --border,
   --radius-*, --shadow-*, and the same hero gradient used on
   .dashboard-hero / .curriculum-hero / .carryover-hero.
   ============================================================ */

.auth-page { overflow-x: clip; }
body.auth-page { background: var(--bg) !important; }

/* Both columns share one continuous gradient — no hard seam between
   the hero copy and the form, so the card reads as floating on top
   of the same surface rather than sitting in a separate panel. */
.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 520px);
  min-height: 100dvh;
  background: linear-gradient(128deg, #0a3f8c 0%, var(--primary) 55%, var(--accent) 165%);
}

/* ---- Hero / brand panel ---- */
.auth-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 56px 48px 56px 56px;
  color: #fff;
  background: transparent;
}
.auth-hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 85% 8%, rgb(255 255 255 / 12%), transparent 32%),
    radial-gradient(circle at 8% 85%, rgb(255 255 255 / 10%), transparent 28%),
    linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  opacity: .55;
  pointer-events: none;
}

/* Soft floating accents — purely decorative, slow and low-opacity so
   they add depth without competing with the copy or the card. */
.auth-floaters { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-floaters span { position: absolute; border-radius: 50%; background: rgb(255 255 255 / 10%); filter: blur(1px); animation: auth-drift 9s ease-in-out infinite; }
.auth-floaters span:nth-child(1) { top: 12%; left: 68%; width: 90px; height: 90px; animation-delay: 0s; }
.auth-floaters span:nth-child(2) { top: 62%; left: 14%; width: 60px; height: 60px; background: rgb(255 255 255 / 8%); animation-delay: 1.4s; animation-duration: 11s; }
.auth-floaters span:nth-child(3) { top: 78%; left: 74%; width: 40px; height: 40px; background: rgb(255 255 255 / 12%); animation-delay: 2.8s; animation-duration: 7.5s; }
@keyframes auth-drift { 0%, 100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-16px) translateX(6px); } }

.auth-hero-content { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; animation: auth-fade-up .5s ease both; }
.auth-hero-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-hero-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 11px; background: rgb(255 255 255 / 12%); font-size: 1.1rem; }
.auth-hero-name { font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; }
.auth-hero h1 { margin: 0 0 12px; color: #fff !important; font-size: clamp(1.6rem, 2.6vw, 2.15rem); line-height: 1.2; }
.auth-hero p { margin: 0 0 36px; color: rgb(255 255 255 / 86%) !important; font-size: .9375rem; }
.auth-feature-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.auth-feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.auth-feature-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; background: rgb(255 255 255 / 14%); font-size: .95rem; }
.auth-feature-list strong { display: block; color: #fff; font-size: .9rem; }
.auth-feature-list p { margin: 3px 0 0; color: rgb(255 255 255 / 78%) !important; font-size: .8125rem; }

/* ---- Form panel: transparent, so the card floats on the shared
   gradient right alongside the hero copy instead of a separate
   flat-colored column. Left padding trimmed so the card sits close
   to the hero paragraph rather than centered in empty space. ---- */
.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 32px 40px 32px 24px; background: transparent; }
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgb(8 25 55 / 30%), 0 6px 16px rgb(8 25 55 / 16%);
  animation: auth-fade-up .45s ease both, auth-float 6s ease-in-out 1s infinite;
}
.auth-card-header { margin-bottom: 16px; text-align: left; }
.auth-card-mark { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-radius: 11px; font-size: 1.1rem; }
.auth-card-header h2 { margin: 0 0 4px; font-size: 1.25rem; }
.auth-card-header p { margin: 0; font-size: .8125rem; }

@keyframes auth-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.auth-alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid; border-radius: var(--radius-sm); font-size: .8125rem; line-height: 1.5; }
.auth-alert i { margin-top: 2px; }
.auth-alert-error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.auth-alert-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }

.auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-field { margin-bottom: 12px; }
.auth-field label { display: block; margin-bottom: 4px; font-size: .8125rem; font-weight: 700; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > i:first-child { position: absolute; left: 13px; color: var(--text-muted); font-size: .85rem; pointer-events: none; }
.auth-input-wrap input,
.auth-input-wrap select { padding-left: 38px !important; }
.auth-input-wrap input[type="password"] { padding-right: 42px !important; }
.auth-input-wrap-select select { padding-right: 34px !important; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%) !important; background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.auth-toggle-password { position: absolute; right: 6px; display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0; color: var(--text-muted); background: transparent; border: 0; cursor: pointer; }
.auth-toggle-password:hover { color: var(--primary); }
.auth-hint { margin: 4px 0 0; color: var(--text-muted); font-size: .6875rem; line-height: 1.35; }
.auth-field-error { min-height: .9em; margin: 4px 0 0; color: var(--danger); font-size: .6875rem; font-weight: 600; }
.auth-input-wrap input.is-invalid,
.auth-input-wrap select.is-invalid { border-color: var(--danger) !important; }
.auth-input-wrap input.is-invalid:focus,
.auth-input-wrap select.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent) !important; }

.auth-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 6px; }
.auth-strength-bar { height: 4px; background: var(--border); border-radius: 999px; transition: background-color .16s ease; }
.auth-strength-bar.is-filled.weak { background: var(--danger); }
.auth-strength-bar.is-filled.fair { background: var(--warning); }
.auth-strength-bar.is-filled.strong { background: var(--success); }

.auth-submit { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 4px; padding: 11px 16px; color: #fff; background: var(--primary); border: 0; border-radius: var(--radius-sm); font-size: .9375rem; font-weight: 700; cursor: pointer; }
.auth-submit:hover { background: var(--primary-hover); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { cursor: not-allowed; opacity: .85; transform: none !important; }
.auth-submit-spinner { display: none; margin-left: 8px; }
.auth-submit.is-loading .auth-submit-spinner { display: inline-block; }
.auth-submit.is-loading .auth-submit-label { font-size: 0; }
.auth-submit.is-loading .auth-submit-label::after { content: "Creating account…"; font-size: .9375rem; }

.auth-switch { margin: 14px 0 0; color: var(--text-muted); font-size: .8125rem; text-align: center; }
.auth-switch a { font-weight: 700; }

@keyframes auth-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Responsive: the hero now STACKS on top of the form instead of
   disappearing, so tablets and phones still get the branded intro. ---- */
@media (max-width: 1080px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 40px 28px 16px; }
  /* Little to no top padding here — the card should sit right under
     the hero paragraph, not floating in a separate block of space. */
  .auth-form-panel { padding: 8px 24px 32px; }
}

@media (max-width: 768px) {
  .auth-hero { padding: 32px 20px 12px; }
  .auth-hero-content { max-width: 480px; }
  .auth-hero h1 { font-size: 1.4rem; }
  .auth-hero p { margin-bottom: 22px; font-size: .875rem; }
  .auth-feature-list { gap: 14px; }
  .auth-form-panel { padding: 4px 18px 32px; }
  .auth-card { padding: 24px 20px; }
  .auth-floaters span:nth-child(1) { width: 60px; height: 60px; }
  .auth-floaters span:nth-child(2) { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  .auth-hero { padding: 26px 16px 10px; }
  .auth-hero-brand { margin-bottom: 16px; }
  .auth-hero h1 { font-size: 1.25rem; }
  .auth-hero p { margin-bottom: 0; }
  /* Feature list adds length without adding registration value on very
     small screens — hide it here to keep scrolling to a minimum while
     still showing the brand, headline and description. */
  .auth-feature-list { display: none; }
  .auth-floaters { display: none; }
  .auth-form-panel { padding: 4px 16px 28px; }
  .auth-card { padding: 20px 16px; }
  .auth-field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 360px) {
  .auth-hero-mark { width: 34px; height: 34px; font-size: .95rem; }
  .auth-hero-name { font-size: .95rem; }
  .auth-card { padding: 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-hero-content, .auth-card { animation: none; }
  .auth-floaters span { animation: none; }
}

/* ============================================================
   REGISTER / LOGIN MOBILE FIX
   ============================================================ */

@media screen and (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .auth-page {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .auth-shell {
        display: block !important;
        width: 100%;
        min-width: 0;
        min-height: 100dvh;
    }

    .auth-hero {
        width: 100%;
        padding: 28px 18px 18px !important;
    }

    .auth-hero-content {
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
    }

    .auth-form-panel {
        width: 100%;
        padding: 8px 14px 28px !important;
    }

    .auth-card {
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        padding: 22px 18px !important;
    }

    .auth-field-row {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .auth-field,
    .auth-input-wrap,
    .auth-input-wrap input,
    .auth-input-wrap select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .auth-submit {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {

    .auth-hero {
        padding: 24px 15px 14px !important;
    }

    .auth-form-panel {
        padding: 6px 12px 24px !important;
    }

    .auth-card {
        padding: 18px 14px !important;
        border-radius: 12px;
    }

    .auth-card-header h2 {
        font-size: 1.15rem;
    }

    .auth-card-header p {
        font-size: .78rem;
    }

    .auth-field label {
        font-size: .78rem;
    }

    .auth-input-wrap input,
    .auth-input-wrap select {
        font-size: 16px !important;
    }
}
