/* DMA Members Portal - design system */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #86053b;
  --red-dark: #5d0329;
  --red-tint: #f8e9f0;
  --orange: #f0801f;
  --green: #6aa617;

  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e5e7eb;
  --line-2: #eef0f3;
  --ring: rgba(134, 5, 59, .20);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 30px -8px rgba(17, 24, 39, .10);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }

.ico { width: 18px; height: 18px; flex: none; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.container { flex: 1; padding-top: 32px; padding-bottom: 56px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--red) 0 60%, var(--orange) 60% 82%, var(--green) 82% 100%);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap;
}
.brand { display: block; line-height: 0; flex: 0 1 auto; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 44px; width: auto; max-width: 100%; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-weight: 500; font-size: .92rem;
  padding: 9px 14px; border-radius: 10px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--red-tint); color: var(--red); }

.userbox { display: flex; align-items: center; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.usermenu { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--ink); }
.usermenu:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
}
.username { font-size: .88rem; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { margin: 0; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--red-tint); color: var(--red); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .84rem; padding: 20px 0; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }

/* ---------- Type ---------- */
h1 { font-size: 1.85rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 6px; }
h2 { font-size: 1.05rem; line-height: 1.3; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 26px; }
.page-head { margin-bottom: 24px; }
.page-head .sub { margin-bottom: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 650; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 20px;
  padding: 34px 36px; margin-bottom: 24px; box-shadow: var(--shadow);
  background:
    radial-gradient(600px 240px at 92% -20%, rgba(240, 128, 31, .55), transparent 70%),
    radial-gradient(420px 220px at 0% 120%, rgba(106, 166, 23, .30), transparent 70%),
    linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
}
.hero h1 { color: #fff; font-size: 2rem; margin-bottom: 6px; }
.hero p { margin: 0; color: rgba(255, 255, 255, .86); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  font-size: .82rem; font-weight: 500; color: #fff;
}
.pill .ico { width: 15px; height: 15px; }

/* ---------- Cards / grid ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid > .card { margin-bottom: 0; }
.grid.fields { gap: 0 18px; }

/* Action tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d9dde3; text-decoration: none; color: var(--ink); }
.tile-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--red-tint); color: var(--red);
}
.tile-icon .ico { width: 20px; height: 20px; }
.tile strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.tile small { color: var(--muted); font-size: .84rem; }
.tile .go { margin-left: auto; color: var(--muted); }
.tile:hover .go { color: var(--red); }

/* ---------- Chips ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; background: var(--red-tint); color: var(--red);
  border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 550; margin: 3px 6px 3px 0;
}
.tag.derived { background: #fff1e0; color: #a5540a; }
.tag.admin { background: var(--ink); color: #fff; }
.tag.auto { padding: 2px 9px; font-size: .72rem; margin: 0 0 0 8px; background: #fff1e0; color: #a5540a; }
.empty { color: var(--muted); }

/* ---------- Committees ---------- */
.year-form { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.year-form label { margin: 0; }
.year-form select { width: auto; min-width: 120px; }
.year-form .btn { margin-top: 0; padding: 10px 18px; }

.body-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.body-head h2 { margin: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
.body-card.b2 .dot { background: var(--orange); }
.body-card.b3 .dot { background: var(--green); }
.body-card.b4 .dot { background: #0e7490; }
.body-card.b5 .dot { background: #6d28d9; }
.count { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--line-2); border-radius: 999px; padding: 3px 10px; }

.seat { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-2); }
.seat:first-of-type { border-top: 0; }
.seat-name { color: var(--muted); font-weight: 500; font-size: .9rem; }
.person { display: inline-flex; align-items: center; gap: 10px; font-weight: 550; }
.person .avatar { width: 28px; height: 28px; font-size: .68rem; background: var(--red-tint); color: var(--red); }
.sublabel { margin: 18px 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; color: var(--muted); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; margin: 0; padding: 0; list-style: none; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 500; font-size: .92rem; }
.people .avatar { width: 28px; height: 28px; font-size: .66rem; background: var(--line-2); color: var(--ink-2); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .84rem; color: var(--ink-2); margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], select {
  width: 100%; height: 44px; padding: 0 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #d1d5db; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #9ca3af; }
input:hover, select:hover { border-color: #b8bec8; }
input:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--ring); }
input[readonly] { background: #f3f4f6; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font-weight: 500; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }

.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.pw-toggle:hover { color: var(--red); background: var(--red-tint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; margin-top: 22px; font: inherit; font-weight: 600; letter-spacing: -0.005em;
  color: #fff; background: var(--red); border: 1px solid var(--red); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; box-shadow: 0 1px 2px rgba(93, 3, 41, .25), 0 6px 16px -6px rgba(134, 5, 59, .55);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { color: var(--red); background: #fff; border-color: #d1d5db; box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--red-tint); border-color: var(--red); color: var(--red-dark); }
.btn.block { width: 100%; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .92rem; border: 1px solid transparent; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.field-error { display: block; margin-top: 5px; color: #b42318; font-size: .82rem; }
.hint { color: var(--muted); font-size: .84rem; margin: 6px 0 0; }
.linkrow { margin: 20px 0 0; font-size: .9rem; text-align: center; }

/* ---------- Sign-in / auth screens ---------- */
body.auth { background: var(--surface); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }

.auth-side {
  position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 56px;
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(240, 128, 31, .60), transparent 65%),
    radial-gradient(520px 320px at 0% 100%, rgba(106, 166, 23, .38), transparent 65%),
    linear-gradient(150deg, var(--red) 0%, var(--red-dark) 100%);
}
.auth-side::after {
  content: ""; position: absolute; inset: 0; opacity: .10; pointer-events: none;
  background-image: radial-gradient(#fff 1.2px, transparent 1.2px); background-size: 26px 26px;
}
.auth-side-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .26);
}
.auth-side h2 { font-size: 2.4rem; line-height: 1.12; letter-spacing: -0.03em; font-weight: 750; margin: 22px 0 14px; }
.auth-side p { font-size: 1.05rem; color: rgba(255, 255, 255, .86); margin: 0 0 30px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-weight: 500; color: rgba(255, 255, 255, .94); }
.auth-points .ico { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .16); }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: block; margin-bottom: 34px; line-height: 0; }
.auth-logo:hover { text-decoration: none; }
.auth-logo img { display: block; width: 100%; max-width: 360px; height: auto; }
.auth-card h1 { font-size: 1.7rem; }
.auth-foot { margin: 36px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }

/* ---------- Admin: lists, badges, toolbar ---------- */
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.head-row .btn { margin-top: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.back:hover { color: var(--red); text-decoration: none; }
.back-ico { display: inline-flex; transform: rotate(180deg); }
.back-ico .ico { width: 16px; height: 16px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.toolbar input[type=text] { flex: 1 1 240px; min-width: 0; width: auto; }
.toolbar select { flex: 0 1 190px; width: auto; }
.toolbar .btn { margin-top: 0; }

.plist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.prow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px;
  padding: 13px 18px; color: var(--ink); border-top: 1px solid var(--line-2); transition: background .12s;
}
.prow:first-child { border-top: 0; }
.prow:hover { background: #fafafb; text-decoration: none; color: var(--ink); }
.prow.inactive .pmain strong, .prow.inactive .avatar { opacity: .55; }
.pmain { min-width: 0; }
.pmain strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.pmain small { display: block; color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--muted); display: inline-flex; }
.prow:hover .chev { color: var(--red); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.badge.ec { background: var(--red-tint); color: var(--red); }
.badge.login { background: #e7f3ff; color: #0b5cad; }
.badge.adm { background: var(--ink); color: #fff; }
.badge.off { background: #fef2f2; color: #991b1b; }
.badge.seat { background: #fff1e0; color: #a5540a; }

.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.yearpick { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .84rem; }
.yearpick select { width: auto; min-width: 100px; height: 38px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pager .btn { margin-top: 0; }
.pager-info { color: var(--muted); font-size: .88rem; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions .btn { margin-top: 4px; }
.btn.small { height: 36px; padding: 0 14px; margin-top: 0; font-size: .86rem; }
.btn.danger { color: #b42318; }
.btn.danger:hover { background: #fef2f2; border-color: #b42318; color: #8a1f1f; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.count { font-weight: 600; }
h2 .count { margin-left: 6px; }

.list { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.lrow, .selrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line-2); color: var(--ink); }
.list > :first-child { border-top: 0; }
.lrow .pmain, .selrow .pmain { flex: 1; min-width: 0; }
.lrow form { margin: 0; }
.selrow { cursor: pointer; margin: 0; font-weight: 400; }
.selrow:hover, a.lrow:hover { background: #fafafb; text-decoration: none; }
.selrow input { width: 20px; height: 20px; accent-color: var(--red); flex: none; }
.sel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form select { flex: 1 1 260px; width: auto; min-width: 0; }
.inline-form .btn { margin-top: 0; }
.stack .btn { margin-top: 16px; }

.seatrow { display: grid; grid-template-columns: minmax(130px, 26%) minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.body-head + .seatrow { border-top: 0; }
.seat-holder { min-width: 0; }
.seat-edit { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.seat-edit select { width: 200px; height: 36px; font-size: .86rem; }

.tile.soon { opacity: .55; cursor: default; }
.tile.soon:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }

/* ---------- Profile ---------- */
.section-title { display: flex; align-items: center; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .username { display: none; }
  .nav a span { display: none; }
  .nav a { padding: 10px 12px; }
  .nav a.active span { display: inline; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { min-height: 100vh; justify-content: flex-start; padding-top: 56px; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  main.container { padding-top: 22px; }
  .header-inner { padding: 8px 16px; }
  .brand img { height: 36px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav a { white-space: nowrap; }
  .nav a span { display: inline; }
  .userbox { margin-left: auto; padding-left: 0; border-left: 0; }
  h1 { font-size: 1.55rem; }
  .hero { padding: 26px 22px; border-radius: 18px; }
  .hero h1 { font-size: 1.6rem; }
  .card { padding: 20px 18px; }
  .seat { grid-template-columns: 1fr; gap: 4px; }

  /* People list: badges drop under the name */
  .prow { grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 14px; }
  .prow .badges { grid-column: 2 / 3; grid-row: 2; margin-top: 2px; }
  .prow .chev { grid-column: 3; grid-row: 1 / span 2; }
  .pmain small { white-space: normal; }
  .toolbar select, .toolbar .btn { flex: 1 1 140px; }
  .head-row .btn { width: 100%; }
  .form-actions .btn { flex: 1 1 140px; }

  /* Seats: name, holder, then the edit controls stack */
  .seatrow { grid-template-columns: 1fr; gap: 6px; }
  .seat-edit select { flex: 1 1 100%; width: 100%; }
  .seat-edit .btn { flex: 1 1 100px; }
  .sel-actions .btn { flex: 1 1 140px; }
  .pager .btn { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
