/* Cancha Libre — Estilos principales (funcionan sin Tailwind CDN) */
:root {
  --pitch: #0b0e11;
  --pitch-card: #15191c;
  --pitch-input: #0f1316;
  --green: #4caf50;
  --green-bright: #5cdb5f;
  --green-dark: #2e7d32;
  --text: #ffffff;
  --muted: #a1a1aa;
  --border: #3f3f46;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--pitch);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Formularios —— */
.input-tw,
select.input-tw,
textarea.input-tw {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--pitch-input);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-tw::placeholder { color: #71717a; }
.input-tw:focus,
select.input-tw:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}
select.input-tw { cursor: pointer; appearance: none; padding-right: 2.5rem; }

.btn-tw-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #68de43 0%, var(--green) 50%, var(--green-dark) 100%);
  color: #0a1a0c;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(76, 175, 80, 0.35);
  transition: filter 0.2s, transform 0.15s;
}
.btn-tw-primary:hover { filter: brightness(1.08); }
.btn-tw-primary:active { transform: scale(0.98); }
.btn-tw-primary.w-full { width: 100%; }

.btn-tw-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: rgba(76, 175, 80, 0.08);
  color: var(--green-bright);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-tw-outline:hover { background: rgba(76, 175, 80, 0.18); text-decoration: none; }

.btn-tw-ghost {
  padding: 8px 14px;
  border: 1px solid #52525b;
  border-radius: 8px;
  background: rgba(39, 39, 42, 0.8);
  color: #d4d4d8;
  font-size: 12px;
  cursor: pointer;
}
.btn-tw-ghost:hover { background: #3f3f46; }

/* —— Auth (login / register) —— */
.auth-bg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
  background: var(--pitch);
}
.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top, rgba(76, 175, 80, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(76, 175, 80, 0.06) 0%, transparent 40%);
  pointer-events: none;
}
.auth-bg > .auth-bg-img {
  position: absolute;
  inset: 0;
  background: url("https://images.unsplash.com/photo-1574629810360-7efbbe195018?auto=format&fit=crop&w=1920&q=80") center/cover;
  opacity: 0.07;
  pointer-events: none;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border: 1px solid rgba(63, 63, 70, 0.8);
  border-radius: var(--radius-lg);
  background: rgba(21, 25, 28, 0.95);
  box-shadow: var(--shadow);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.5), transparent);
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.auth-brand:hover { text-decoration: none; opacity: 0.9; }
.auth-brand-icon {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.2);
  font-size: 18px;
}
.auth-brand .accent { color: var(--green-bright); }
.auth-title { margin: 0; font-size: 26px; font-weight: 800; }
.auth-sub { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.role-tabs {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--pitch-input);
}
.role-pill {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.role-pill:hover { text-decoration: none; color: #e4e4e7; background: rgba(63, 63, 70, 0.5); }
.role-pill-active {
  background: linear-gradient(180deg, rgba(76, 175, 80, 0.25), rgba(76, 175, 80, 0.08));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.4);
}

.cp-form { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.cp-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.cp-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.code-input { letter-spacing: 0.35em; text-align: center; font-size: 22px; font-weight: 700; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th,
.admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(63, 63, 70, 0.6); }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: rgba(0, 0, 0, 0.2); }
.admin-table tr:last-child td { border-bottom: none; }
.code-chip { display: inline-block; padding: 4px 10px; border-radius: 6px; background: rgba(76, 175, 80, 0.15); color: var(--green-bright); font-weight: 800; letter-spacing: 0.2em; }
.cp-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.cp-footer a { font-weight: 600; color: var(--green-bright); }

/* —— Layout app (jugador / dueño) —— */
.cp-app {
  display: flex;
  min-height: 100vh;
  background: var(--pitch);
}
.cp-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-right: 1px solid rgba(63, 63, 70, 0.6);
  background: var(--pitch-card);
}
.cp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cp-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(63, 63, 70, 0.6);
  background: rgba(11, 14, 17, 0.9);
}
.cp-content { flex: 1; padding: 24px 32px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 2px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(63, 63, 70, 0.5); color: var(--text); text-decoration: none; }
.nav-item-active {
  background: linear-gradient(90deg, var(--green), #43a047);
  color: #0a1a0c !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}
.nav-item-active:hover { color: #0a1a0c !important; }

.card-tw {
  padding: 24px;
  border: 1px solid rgba(63, 63, 70, 0.8);
  border-radius: var(--radius-lg);
  background: var(--pitch-card);
  box-shadow: var(--shadow);
}
.page-title { margin: 0; font-size: 24px; font-weight: 800; }
.page-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.page-header { margin-bottom: 32px; }

.list-tw {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(63, 63, 70, 0.8);
  border-radius: var(--radius);
  background: var(--pitch-input);
}
.stat-tw {
  padding: 24px;
  border: 1px solid rgba(63, 63, 70, 0.8);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--pitch-card), var(--pitch));
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-tw .val { font-size: 28px; font-weight: 800; color: var(--green-bright); }
.stat-tw .lbl { margin-top: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.pill { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.pill-ok { background: rgba(76, 175, 80, 0.2); color: var(--green-bright); }
.pill-warn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.pill-bad { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.grid-2 { display: grid; gap: 24px; }
.grid-stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid-canchas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Landing */
.landing {
  position: relative;
  min-height: 100vh;
  background: var(--pitch);
  overflow: hidden;
}
.landing-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('landing-futbol5-bg.jpg') center center / cover no-repeat;
}
.landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 10, 12, 0.82) 0%, rgba(8, 10, 12, 0.88) 45%, rgba(8, 10, 12, 0.94) 100%);
}
.landing-content {
  position: relative;
  z-index: 2;
}
.landing-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 200px;
  max-height: 140px;
  object-fit: contain;
  margin: 0 auto 28px;
}
.landing-hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  text-align: center;
}
.landing-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; margin: 0 0 16px; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6); }
.landing-hero .accent-text { color: var(--green-bright); }
.landing-hero p { font-size: 18px; color: #d4d4d8; margin: 0 auto 32px; max-width: 560px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.landing-cta { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.landing-cta-btn { padding: 14px 32px; font-size: 16px; text-decoration: none; min-width: 220px; text-align: center; }
.landing-register { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.landing-register-title { margin: 0; font-size: 15px; font-weight: 600; color: #e4e4e7; }
.landing-features { max-width: 960px; margin: 0 auto; padding: 0 24px 48px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.feature-card {
  padding: 16px;
  border: 1px solid rgba(63, 63, 70, 0.8);
  border-radius: var(--radius);
  background: rgba(18, 22, 26, 0.85);
  backdrop-filter: blur(8px);
  font-size: 14px;
}
.landing-footer-tag { text-align: center; font-size: 20px; font-weight: 700; color: var(--green-bright); padding-bottom: 60px; margin: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 360px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
#toast.ok { background: var(--green); color: #0a1a0c; }
#toast.error { background: #ef4444; color: #fff; }

/* Cancha card */
.cancha-card {
  overflow: hidden;
  border: 1px solid rgba(63, 63, 70, 0.8);
  border-radius: var(--radius-lg);
  background: var(--pitch-card);
  transition: transform 0.2s, border-color 0.2s;
}
.cancha-card:hover { transform: translateY(-2px); border-color: rgba(76, 175, 80, 0.4); }
.cancha-card-img { height: 140px; background-size: cover; background-position: center; position: relative; }
.cancha-card-badge {
  position: absolute; top: 10px; right: 10px;
  padding: 4px 8px; border-radius: 6px;
  background: var(--green); color: #0a1a0c;
  font-size: 10px; font-weight: 700;
}
.cancha-card-body { padding: 16px; }
.cancha-card-body h4 { margin: 0 0 8px; font-size: 16px; }
.cancha-price { color: var(--green-bright); font-weight: 700; font-size: 14px; }
.slots-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.slot-card {
  flex: 0 0 140px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--pitch-card);
  text-align: center;
}

.scrollbar-thin::-webkit-scrollbar { height: 6px; width: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #52525b; border-radius: 99px; }

input[type="date"], input[type="time"] { color-scheme: dark; }

@media (max-width: 900px) {
  .cp-app { flex-direction: column; }
  .cp-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
}

@media (min-width: 901px) {
  .cp-app { display: grid; grid-template-columns: 260px 1fr; }
}
