/* ==========================================================================
   Petanque Registration — UI
   Σκόπιμα διαφορετικό από το προηγούμενο project:
   ελαφρύ dark sidebar, card-based content, palette pétanque-earth.
   ========================================================================== */

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --ink: #1f1d1b;
  --ink-soft: #5a544d;
  --ink-mute: #8a8379;
  --line: #e5e1d8;
  --brand: #7a2d12;          /* σκούρο terracotta */
  --brand-soft: #d9a27e;
  --accent: #2d5f3f;         /* πράσινο γκαζόν */
  --danger: #b42318;
  --warning: #b45309;
  --success: #15803d;
  --info: #0369a1;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(31,29,27,.06);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Login layout ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(122,45,18,.08), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(45,95,63,.08), transparent 40%),
    var(--bg);
  padding: 24px;
}
.auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.auth__title {
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.auth__sub {
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-size: 14px;
}
.auth__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 8px;
}
.auth__tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
  font-weight: 500;
}
.auth__tab--active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #221f1c;
  color: #e8e2d8;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}
.sidebar__brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar__title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
  margin: 0;
}
.sidebar__subtitle {
  color: #a9a198;
  font-size: 12px;
  margin: 2px 0 0;
}
.sidebar__nav {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__link {
  padding: 10px 20px;
  color: #c9c2b7;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.sidebar__link:hover { background: rgba(255,255,255,.04); text-decoration: none; color: #fff; }
.sidebar__link--active {
  background: rgba(255,255,255,.06);
  border-left-color: var(--brand-soft);
  color: #fff;
}
.sidebar__footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 12px;
  color: #a9a198;
}
.sidebar__user {
  font-weight: 600;
  color: #fff;
}

.main {
  padding: 28px 32px 48px;
  max-width: 1200px;
}
.main__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.main__title {
  font-size: 22px;
  margin: 0;
  letter-spacing: -.01em;
}
.main__sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 4px 0 0;
}

/* ---------- Components ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink);
}
.card__subtitle {
  color: var(--ink-soft);
  font-size: 13px;
  margin: -8px 0 14px;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 780px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.stat {
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat__label { color: var(--ink-mute); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat__value { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: #fff; }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--danger { background: var(--danger); }
.btn--accent { background: var(--accent); }
.btn--sm { padding: 6px 10px; font-size: 12px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field__label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.input, .select, .textarea {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid rgba(122,45,18,.18);
  border-color: var(--brand);
}
.field__hint { font-size: 12px; color: var(--ink-mute); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge--M   { background: #e8efff; color: #2142a8; border-color: #c9d6ff; }
.badge--F   { background: #ffe8f2; color: #a01f5c; border-color: #ffc9df; }
.badge--MIX { background: #fff4d9; color: #8a5a00; border-color: #ffe5a3; }
.badge--on  { background: #d4edda; color: #14532d; border-color: #a7d9b6; }
.badge--off { background: #f3d4d4; color: #7a1d1d; border-color: #eaa9a9; }

/* Flash */
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash--success { background: #e7f5ec; color: #14532d; border-color: #bde5ca; }
.flash--error   { background: #fdecec; color: #7a1d1d; border-color: #f5c4c4; }
.flash--warning { background: #fff4e0; color: #7a4a00; border-color: #f5d9a0; }
.flash--info    { background: #e7f1f9; color: #0b3c5d; border-color: #bdd7e8; }

/* Utility */
.muted { color: var(--ink-mute); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.right { text-align: right; }
.tc    { text-align: center; }

/* Team builder */
.builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 820px) { .builder { grid-template-columns: 1fr; } }
.players-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.player-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.player-row:last-child { border-bottom: 0; }
.player-row:hover { background: #fff; }
.player-row--selected { background: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.player-row--disabled { opacity: .45; cursor: not-allowed; }
.player-row input[type="checkbox"] { margin-right: 8px; }
.selected-box {
  min-height: 100px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}
.selected-box .player-row { background: transparent; cursor: default; }
