/* NIT Event Manager — palette built on #012c61 (blue) + #B61247 (red) */
:root {
  --blue-900: #011f44;
  --blue-800: #012c61; /* primary */
  --blue-700: #023a7d;
  --blue-600: #024aa0;
  --blue-200: #b9cbe6;
  --blue-100: #e7eef7;
  --blue-50:  #f3f7fc;

  --red-700: #93103a;
  --red-600: #b61247; /* accent */
  --red-500: #d11953;
  --red-100: #fbe6ed;
  --red-50:  #fdf2f6;

  --ink:   #16203a;
  --muted: #5a6b85;
  --line:  #dde4ef;
  --bg:    #f5f7fb;
  --card:  #ffffff;

  --ok:    #1c7c54;
  --ok-bg: #e3f5ec;
  --warn:  #9a6700;
  --warn-bg:#fbf0d3;
  --info:  var(--blue-700);
  --info-bg: var(--blue-100);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(1,44,97,.06), 0 8px 24px rgba(1,44,97,.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}
a { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.2; color: var(--blue-900); }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 640px; }
.form-narrow { max-width: 680px; margin: 0 auto; }

/* Header / brand bar */
.topbar {
  background: var(--blue-800);
  background: linear-gradient(100deg, var(--blue-900), var(--blue-700));
  color: #fff;
  border-bottom: 3px solid var(--red-600);
}
.topbar .container,
.topbar .container-wide { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .2px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red-500); box-shadow: 0 0 0 4px rgba(182,18,71,.25); }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; display: block; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: #dce6f4; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
.lang-switch a { padding: 2px 7px; border-radius: 6px; }
.lang-switch a.active { background: rgba(255,255,255,.18); color: #fff; }

/* Layout */
main { padding: 32px 0 64px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.card + .card { margin-top: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Hero event */
.event-hero h1 { margin: 0 0 6px; font-size: 30px; }
.event-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin: 22px 0; }
.event-meta .item { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius-sm); padding: 12px 14px; }
.event-meta .item .label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-700); font-weight: 600; }
.event-meta .item .value { font-size: 15px; margin-top: 2px; }
.event-desc { margin-top: 8px; }
.event-desc :where(p,ul,ol) { margin: 0 0 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  text-decoration: none; transition: filter .12s ease, background .12s ease;
}
.btn-primary { background: var(--blue-800); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-accent { background: var(--red-600); color: #fff; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: #fff; color: var(--blue-800); border-color: var(--line); }
.btn-ghost:hover { background: var(--blue-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--red-700); border-color: var(--red-100); }
.btn-danger:hover { background: var(--red-50); }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--blue-900); }
.field .req { color: var(--red-600); }
.input, .select, textarea, input[type=text], input[type=email], input[type=password],
input[type=number], input[type=datetime-local] {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.input:focus, .select:focus, textarea:focus, input:focus {
  outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(2,74,160,.15);
}
textarea { min-height: 90px; resize: vertical; }
.field .error { color: var(--red-600); font-size: 13px; margin-top: 5px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; }
.checkbox input { width: auto; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.honeypot { position: absolute; left: -9999px; }

/* Slide-to-confirm captcha */
.slide-captcha { user-select: none; max-width: 420px; }
.slide-captcha__track {
  position: relative; height: 48px; border-radius: var(--radius-sm);
  background: var(--blue-50); border: 1px solid var(--blue-200); overflow: hidden;
}
.slide-captcha__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--blue-100); transition: background .2s ease;
}
.slide-captcha__label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--blue-800); pointer-events: none; padding-left: 40px;
}
.slide-captcha__handle {
  position: absolute; left: 0; top: 0; height: 48px; width: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm); cursor: grab; touch-action: none;
  background: var(--blue-800); color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 1px 4px rgba(1,44,97,.3);
}
.slide-captcha__handle:active { cursor: grabbing; }
.slide-captcha__handle:focus-visible { outline: 3px solid rgba(2,74,160,.4); outline-offset: 2px; }
.slide-captcha.is-done .slide-captcha__track { border-color: #b6e3cb; }
.slide-captcha.is-done .slide-captcha__fill { background: var(--ok-bg); }
.slide-captcha.is-done .slide-captcha__label { color: var(--ok); font-weight: 600; }
.slide-captcha.is-done .slide-captcha__handle { background: var(--ok); cursor: default; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 0 0 18px; }
fieldset legend { padding: 0 8px; font-weight: 700; color: var(--blue-800); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-info { background: var(--info-bg); color: var(--blue-900); border-color: var(--blue-200); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #ecd99a; }
.alert-ok   { background: var(--ok-bg); color: var(--ok); border-color: #b6e3cb; }
.alert-error{ background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: var(--blue-50); color: var(--blue-800); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.table tr:hover td { background: var(--blue-50); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-applied    { background: var(--info-bg); color: var(--blue-800); }
.badge-paid       { background: #ece4fb; color: #5b32a8; }
.badge-confirmed  { background: var(--ok-bg); color: var(--ok); }
.badge-cancelled  { background: #eef1f5; color: var(--muted); }
.badge-waitlisted { background: var(--warn-bg); color: var(--warn); }
.tag { display:inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; background: var(--blue-100); color: var(--blue-800); }
code.ph { display:inline-block; background: var(--blue-50); border:1px solid var(--blue-100); color: var(--blue-700); padding: 1px 6px; border-radius: 5px; font-size: 12px; margin: 0 2px 4px 0; }
.inherited-default { margin-top: 6px; padding: 10px 12px; background: var(--blue-50); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }

/* Admin shell */
.admin-head { display:flex; align-items:center; justify-content:space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-size: 24px; margin: 0; }
.toolbar { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
.filters { display:flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; align-items: center; }
.filters a { text-decoration:none; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 999px; border:1px solid var(--line);
  background:#fff; color: var(--muted); font-size: 13px; line-height: 1; white-space: nowrap;
}
.pill.active { background: var(--blue-800); color:#fff; border-color: var(--blue-800); }
.filters .input { height: 34px; }
.filters .btn-sm { height: 34px; }
.row-actions { display:flex; gap: 8px; align-items: center; }

/* Row-action dropdown (native <details>) */
.menu { position: relative; display: inline-block; }
.menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--blue-800);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "▾"; font-size: 10px; color: var(--muted); }
.menu[open] > summary { background: var(--blue-50); border-color: var(--blue-200); }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; text-align: left;
}
.menu-list .group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px 2px; }
.menu-item, .menu-item:visited { display: block; width: 100%; text-align: left; box-sizing: border-box;
  padding: 7px 8px; font: inherit; font-size: 13px; border: 0; background: none; color: var(--ink);
  border-radius: 6px; cursor: pointer; text-decoration: none; }
.menu-item:hover { background: var(--blue-50); }
.menu-item.danger { color: var(--red-700); }
.menu-item.danger:hover { background: var(--red-50); }
.menu-divider { height: 1px; background: var(--line); margin: 5px 2px; }

/* Batch action bar */
.batchbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--blue-50); border: 1px solid var(--blue-200);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
}
.batchbar.hidden { display: none; }
.batchbar span { font-size: 14px; }
.batchbar .count { font-weight: 700; color: var(--blue-800); }
.batchbar .select { max-width: 240px; height: 38px; font-size: 14px; padding: 0 12px; line-height: 1.2; }
.checkbox-col { width: 36px; text-align: center; }
.checkbox-col input { width: auto; }

/* Rich text editor */
.rt-toolbar { display: flex; gap: 4px; flex-wrap: wrap; border: 1px solid var(--line);
  border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--blue-50); padding: 6px; }
.rt-toolbar button { font: inherit; font-size: 13px; min-width: 32px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--blue-800); }
.rt-toolbar button:hover { background: var(--blue-100); }
.rt-editor { min-height: 140px; border: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 12px 14px; background: #fff; }
.rt-editor:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(2,74,160,.12); }
.rt-editor :where(h2,h3,h4){ margin: .4em 0; }
.rt-editor :where(p,ul,ol){ margin: 0 0 .6em; }

/* Event image */
.event-image { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; display: block; }
.event-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.image-preview { max-width: 280px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 8px 0; display: block; }
.kv { display:grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
.stat-strip { display:flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background:#fff; border:1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 13px; }
.stat b { font-size: 18px; color: var(--blue-800); display:block; }

/* Modal (email preview) */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(1,20,44,.55);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal.hidden { display: none; }
.modal__box { background: #fff; border-radius: var(--radius); width: 100%; max-width: 680px;
  max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden; }
.modal__head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--blue-50); }
.modal__subject { padding: 12px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal__frame { border: 0; width: 100%; flex: 1; min-height: 320px; background: #fff; }

.footer { color: var(--muted); font-size: 13px; text-align:center; padding: 24px 0 40px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============================ Public event page ============================ */
.hero {
  position: relative; border-radius: 18px; overflow: hidden;
  min-height: 360px; display: flex; align-items: flex-end;
  box-shadow: var(--shadow); margin-bottom: 28px;
  background: linear-gradient(120deg, var(--blue-900), var(--blue-700) 60%, var(--red-700));
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero--noimg { min-height: 260px; }
.hero-overlay {
  position: relative; z-index: 1; width: 100%; color: #fff;
  padding: 48px 40px 32px;
  background: linear-gradient(to top, rgba(1,20,44,.92) 0%, rgba(1,20,44,.55) 45%, rgba(1,20,44,0) 100%);
}
.hero--noimg .hero-overlay { background: none; }
.hero h1 { color: #fff; font-size: 38px; line-height: 1.12; margin: 12px 0 0; max-width: 880px; text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.tag--on-dark { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; }
.hero-fact { font-size: 15px; color: #eaf1fb; font-weight: 500; }

.event-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px; align-items: start;
}
.event-main { padding: 32px 36px; }
.event-main .event-desc { font-size: 16.5px; line-height: 1.7; color: #2a3550; }
.event-main .event-desc :where(p, ul, ol) { margin: 0 0 14px; }
.event-main .event-desc h2 { font-size: 22px; margin: 26px 0 10px; }
.event-main .event-desc h3 { font-size: 18px; margin: 22px 0 8px; }

.event-aside { position: sticky; top: 24px; }
.register-card { padding: 24px 24px 26px; border-top: 4px solid var(--red-600); }
.register-card__title { font-size: 20px; margin: 0 0 16px; }
.facts { margin: 0 0 22px; display: grid; gap: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts > div:first-child { padding-top: 0; }
.facts dt { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; flex: 0 0 auto; }
.facts dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.facts dd a { font-weight: 500; }
.facts__price { color: var(--red-600); font-size: 18px; }
.register-card__cta { width: 100%; font-size: 16px; padding: 13px; }

@media (max-width: 880px) {
  .event-layout { grid-template-columns: 1fr; }
  .event-aside { position: static; }
  .hero h1 { font-size: 30px; }
  .hero-overlay { padding: 36px 24px 24px; }
  .event-main { padding: 24px; }
}

/* "Other events" widget in the sidebar (under the registration card) */
.other-events { margin-top: 20px; padding: 18px 20px; }
.other-events__title { font-size: 16px; margin: 0 0 8px; color: var(--blue-900); }
.oe-item {
  display: flex; gap: 12px; align-items: center; padding: 11px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.oe-item:last-child { border-bottom: 0; padding-bottom: 0; }
.oe-thumb {
  width: 56px; height: 42px; border-radius: 8px; object-fit: cover; flex: 0 0 auto;
  background: linear-gradient(120deg, var(--blue-800), var(--red-700));
}
.oe-text { min-width: 0; }
.oe-title { display: block; font-weight: 600; font-size: 14px; color: var(--blue-900); line-height: 1.3; }
.oe-date { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.oe-item:hover .oe-title { color: var(--blue-600); }

/* Public events grid page */
.events-page-title { font-size: 30px; margin: 4px 0 24px; }
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ev-tile {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.ev-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(1,44,97,.13); }
.ev-tile__media {
  position: relative; display: block; height: 170px; background-size: cover; background-position: center;
  background-color: var(--blue-800); padding: 12px; text-decoration: none;
}
.ev-tile__media--noimg { background: linear-gradient(120deg, var(--blue-800), var(--red-700)); }
.ev-tile__featured { position: absolute; top: 12px; right: 12px; color: #ffd84d; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.ev-tile__body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.ev-tile__title { font-size: 18px; margin: 0 0 6px; line-height: 1.25; }
.ev-tile__title a { color: var(--blue-900); text-decoration: none; }
.ev-tile__title a:hover { color: var(--blue-600); }
.ev-tile__date { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.ev-tile__desc { font-size: 14.5px; color: #2a3550; line-height: 1.55; margin: 0 0 16px; }
.ev-tile__cta { margin-top: auto; align-self: flex-start; }

@media (max-width: 640px) {
  .events-grid { grid-template-columns: 1fr; }
  .events-page-title { font-size: 24px; }
}
