/* PTWD Team — Blue & Yellow */
:root {
  --navy: #0a1a3f;
  --navy-2: #102a63;
  --blue: #1f4fd8;
  --blue-2: #3d6cf0;
  --sky: #e8efff;
  --yellow: #ffcc1f;
  --yellow-2: #ffe27a;
  --ink: #0d1530;
  --muted: #5b6687;
  --line: #dfe5f5;
  --card: #ffffff;
  --bg: #f4f7ff;
  --danger: #e0394f;
  --ok: #14a46c;
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(10, 26, 63, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }

/* ---------- Brand mark ---------- */
.mark {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: #fff;
  text-decoration: none;
}
.mark__badge {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--yellow); color: var(--navy);
  display: grid; place-items: center; font-weight: 800;
  box-shadow: 4px 4px 0 var(--blue-2);
  transform: rotate(-6deg);
}
.mark__badge svg { width: 22px; height: 22px; }

/* ---------- Auth split screen ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth__hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 80% 15%, rgba(61,108,240,.55), transparent 45%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, var(--blue) 120%);
  color: #fff;
  padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth__hero::before { /* yellow sash */
  content: ""; position: absolute; left: -20%; right: -20%; bottom: 18%;
  height: 120px; background: var(--yellow);
  transform: rotate(-12deg);
  box-shadow: 0 0 0 14px rgba(255,204,31,.18);
}
.auth__hero::after { /* stripes */
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(-12deg, transparent 0 22px, rgba(255,255,255,.04) 22px 24px);
  pointer-events: none;
}
.hero__copy { position: relative; z-index: 1; max-width: 30rem; }
.hero__kicker {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy); background: var(--yellow); padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.hero__title { font-size: clamp(2.2rem, 4.6vw, 3.8rem); line-height: 1.02; }
.hero__title em { font-style: normal; color: var(--yellow); }
.hero__sub { color: #c9d6ff; font-size: 1.05rem; line-height: 1.6; margin-top: 1rem; }
.hero__team { position: relative; z-index: 1; display: flex; gap: -8px; align-items: center; }
.hero__team span {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-family: var(--display);
  border: 3px solid var(--navy); margin-left: -10px;
}
.hero__team span:first-child { margin-left: 0; }
.hero__team span:nth-child(odd) { background: var(--yellow); color: var(--navy); }
.hero__team span:nth-child(even) { background: var(--blue-2); color: #fff; }
.hero__team small { margin-left: .9rem; color: #c9d6ff; }

.auth__panel {
  display: grid; place-items: center;
  padding: clamp(24px, 5vw, 64px) 16px;
}
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 40px);
}
.auth__card { width: 100%; max-width: 420px; position: relative; }
.auth__card::before {
  content: ""; position: absolute; top: -10px; left: 28px; width: 70px; height: 10px;
  background: var(--yellow); border-radius: 6px 6px 0 0;
}
.auth__card h2 { font-size: 1.8rem; }
.auth__card .lead { color: var(--muted); margin: .4rem 0 1.6rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .4rem; }
.input-wrap { position: relative; }
.input, select.input {
  width: 100%; font: inherit; color: var(--ink);
  padding: .85rem 1rem; border-radius: 12px;
  border: 2px solid var(--line); background: #fbfcff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(31,79,216,.15); }
.toggle-pw {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600;
  cursor: pointer; padding: .4rem .6rem; border-radius: 8px;
}
.toggle-pw:hover { background: var(--sky); color: var(--blue); }
.hint { font-size: .82rem; color: var(--muted); margin-top: .35rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  padding: .85rem 1.3rem; border-radius: 12px; border: 2px solid transparent;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 0 var(--navy); }
.btn-primary:hover { background: var(--blue-2); }
.btn-primary:active { box-shadow: 0 3px 0 var(--navy); transform: translateY(3px); }
.btn-yellow { background: var(--yellow); color: var(--navy); box-shadow: 0 5px 0 #c99a00; }
.btn-yellow:hover { background: var(--yellow-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: transparent; color: var(--danger); border-color: #f6cbd2; }
.btn-danger:hover { background: #fff1f3; }
.btn-sm { padding: .45rem .75rem; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.alert {
  border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; margin-bottom: 1rem;
  border-left: 5px solid;
}
.alert-error { background: #fff1f3; border-color: var(--danger); color: #8f1d2d; }
.alert-ok { background: #ecfbf4; border-color: var(--ok); color: #0c6a46; }
.alert-info { background: #fff8db; border-color: var(--yellow); color: #6b5300; }

.note {
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px dashed var(--line);
  font-size: .85rem; color: var(--muted); line-height: 1.5;
}
.note strong { color: var(--ink); }

/* ---------- App shell ---------- */
.topbar {
  background: var(--navy); color: #fff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 5px solid var(--yellow);
}
.topbar__inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.topbar nav a, .topbar nav button {
  color: #c9d6ff; text-decoration: none; font: inherit; font-weight: 600; font-size: .9rem;
  padding: .5rem .8rem; border-radius: 10px; background: transparent; border: 0; cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.active { color: var(--navy); background: var(--yellow); }

.page { max-width: 1100px; margin: 0 auto; padding: 32px 16px 64px; }

.welcome {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--blue) 0%, var(--navy-2) 100%);
  color: #fff; border-radius: 24px; padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}
.welcome::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  border-radius: 50%; background: var(--yellow); opacity: .95;
}
.welcome::before {
  content: ""; position: absolute; right: 120px; bottom: -50px; width: 120px; height: 120px;
  border-radius: 50%; border: 14px solid rgba(255,204,31,.4);
}
.welcome > * { position: relative; z-index: 1; }
.welcome h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); max-width: 70%; }
.welcome p { color: #d6e0ff; margin: .5rem 0 0; max-width: 60%; }

.avatar {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  background: var(--yellow); color: var(--navy);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem;
  box-shadow: 4px 4px 0 var(--navy);
}
.avatar-sm { width: 36px; height: 36px; border-radius: 10px; font-size: .85rem; box-shadow: 3px 3px 0 var(--blue); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 22px; }
.stat { padding: 22px; }
.stat__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.stat__value { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin-top: .4rem; word-break: break-word; }
.stat--accent { background: var(--yellow); border-color: #f1bc00; }
.stat--accent .stat__label { color: #6b5300; }

.pill {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px;
}
.pill-admin { background: var(--yellow); color: var(--navy); }
.pill-member { background: var(--sky); color: var(--blue); }
.pill-pending { background: #fff3c4; color: #7a5d00; }
.pill-active { background: #e2f7ee; color: #0c6a46; }
.pill-off { background: #f0f1f5; color: #6b7280; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.section-title { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.section-title::before { content: ""; width: 8px; height: 22px; border-radius: 4px; background: var(--yellow); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .6rem .7rem; border-bottom: 2px solid var(--line); }
td { padding: .8rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fafbff; }
.user-cell { display: flex; align-items: center; gap: .7rem; }
.user-cell small { display: block; color: var(--muted); }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.code-box {
  margin-top: 1rem; border-radius: 14px; padding: 1rem;
  background: var(--navy); color: #fff; border: 3px dashed var(--yellow);
}
.code-box__code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.4rem; font-weight: 700;
  color: var(--yellow); letter-spacing: .08em; margin: .4rem 0 .6rem; word-break: break-all;
}
.code-box p { margin: 0; font-size: .85rem; color: #c9d6ff; }

.strength { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: .5rem; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__hero { min-height: 280px; }
  .auth__hero::before { bottom: 8%; height: 70px; }
  .hero__team { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .welcome h1, .welcome p { max-width: 100%; }
  .welcome::after { width: 140px; height: 140px; right: -50px; top: -50px; }
}

/* ---------- Single-column login ---------- */
.auth--single { grid-template-columns: 1fr; }
.auth--single .auth__panel { min-height: 100vh; }
.auth__single { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.mark--dark { color: var(--navy); }
