@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #f6f7f9;
  --ink: #182231;
  --ink-soft: #5b6572;
  --surface: #ffffff;
  --border: #e2e6ec;
  --blue: #0071cd;
  --blue-dark: #00579e;
  --blue-soft: #e3eefb;
  --error: #c23b22;
  --error-soft: #fbe3dc;
  --success: #2f7a4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(24, 34, 49, 0.06), 0 8px 24px rgba(24, 34, 49, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  background: var(--blue);
  color: #fff;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn.secondary:hover { background: #fff; border-color: var(--ink-soft); }
.btn.danger { background: var(--error); }
.btn.danger:hover { background: #a02f1b; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

input, select {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
.field { margin-bottom: 16px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 26px; display: block; }
.brand span { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

.user-chip { display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
}
.badge.club { background: var(--blue-soft); color: var(--blue-dark); }

.court-mark {
  position: absolute;
  right: -60px;
  top: -40px;
  width: 420px;
  height: 260px;
  opacity: 0.07;
  pointer-events: none;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.login-logo { height: 34px; margin-bottom: 20px; display: block; }
.login-card h1 { font-size: 28px; margin-bottom: 4px; }
.login-card .eyebrow { margin-bottom: 10px; display: block; }
.login-error {
  background: var(--error-soft);
  color: #8f2f1a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

.portal { max-width: 960px; margin: 0 auto; padding: 40px 28px; }
.portal h2 { font-size: 40px; margin-bottom: 10px; }
.portal .eyebrow { margin-bottom: 24px; display: block; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.tool-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.tool-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tool-card .mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.tool-card .mark svg { width: 18px; height: 18px; stroke: #fff; }
.tool-card h3 { font-size: 19px; }
.tool-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.loading { color: var(--ink-soft); font-size: 14px; padding: 40px; text-align: center; }

@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } }

.env-banner {
  background: #d97706;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px;
}
body.env-dev { --blue: #d97706; --blue-dark: #b45309; --blue-soft: #fdecd2; }
