:root {
  --bg: #d8e5ea;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: #fff;
  --text: #102333;
  --muted: #657286;
  --accent: #064c73;
  --accent-2: #0e86c8;
  --danger: #c9241c;
  --ok: #14914a;
  --radius: 28px;
  font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.78), transparent 32%),
    linear-gradient(135deg, #edf6f8, var(--bg));
  color: var(--text);
}

body.auth-body {
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 135, 255, 0.28), transparent 31rem),
    radial-gradient(circle at 84% 82%, rgba(0, 69, 106, 0.24), transparent 34rem),
    linear-gradient(135deg, #e9f4fa 0%, #d8eaf3 48%, #f1f7fa 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 52px;
}

.hero,
.card,
.stepper,
.success-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 44px rgba(19, 58, 82, 0.1);
  backdrop-filter: blur(10px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.95;
}

.hero p,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.stack {
  display: grid;
  gap: 14px;
}

.card,
.success-card {
  padding: 20px;
}

.subscriptions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 10px;
}

.stepper span {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.stepper span.active {
  background: var(--accent);
  color: #fff;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 800;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(16, 35, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  padding: 12px 14px;
}

button,
.button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--accent);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.message,
.empty {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

.error {
  background: rgba(201, 36, 28, 0.1);
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.auth-body .shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.auth-body .app-hero {
  display: none;
}

.login-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: clamp(20px, 5vw, 64px);
}

.login-shell::before,
.login-shell::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  content: "";
  filter: blur(1px);
}

.login-shell::before {
  width: min(42vw, 560px);
  aspect-ratio: 1;
  top: -22%;
  right: -10%;
}

.login-shell::after {
  width: min(34vw, 430px);
  aspect-ratio: 1;
  bottom: -20%;
  left: -8%;
}

.login-panel {
  width: min(480px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 24px 70px rgba(0, 69, 106, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: clamp(30px, 6vw, 48px);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.login-panel .eyebrow {
  margin-bottom: 10px;
  color: #00456a;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.login-panel h1 {
  color: #071f2c;
  font-size: clamp(2rem, 6vw, 2.65rem);
  letter-spacing: -0.025em;
}

.login-panel .stack {
  gap: 16px;
}

.login-panel .spaced {
  margin-top: 30px;
}

.login-field {
  display: grid;
  gap: 8px;
  color: #071f2c;
  font-size: 0.86rem;
  font-weight: 700;
}

.login-panel input {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 2px rgba(0, 69, 106, 0.04);
  padding: 0 18px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.login-panel input:focus {
  border-color: #0087ff;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(0, 135, 255, 0.14);
}

.login-panel button {
  min-height: 54px;
  margin-top: 4px;
  border: 1px solid #006fae;
  border-radius: 40px;
  background: #00456a;
  box-shadow: 0 6px 12px rgba(0, 69, 106, 0.25);
  font-size: 1rem;
}

.login-panel button:hover {
  background: #0087ff;
}

.auth-message {
  position: fixed;
  right: clamp(16px, 4vw, 42px);
  bottom: clamp(16px, 4vw, 42px);
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 40px rgba(0, 69, 106, 0.14);
}

.competition-list {
  display: grid;
  gap: 14px;
}

.competition-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(19, 58, 82, 0.08);
}

.competition-card h3 {
  margin: 8px 0 6px;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.competition-card small {
  display: block;
  max-width: 680px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-dot-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 900;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(16, 35, 51, 0.04);
}

.status-dot.open {
  background: var(--ok);
}

.status-dot.closed {
  background: var(--danger);
}

.competition-card-actions {
  max-width: 520px;
  justify-content: flex-end;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: auto;
  background: rgba(7, 31, 44, 0.34);
  padding: clamp(12px, 3vw, 34px);
}

.modal-panel {
  width: min(1180px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 34px;
  background: rgba(239, 247, 250, 0.92);
  box-shadow: 0 30px 80px rgba(0, 69, 106, 0.24);
  padding: clamp(18px, 3vw, 30px);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.member-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
}

.scanner-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(6, 76, 115, 0.08);
}

.summary-list {
  display: grid;
  gap: 8px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(16, 35, 51, 0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(16, 35, 51, 0.08);
  text-align: left;
  vertical-align: top;
}

.badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(6, 76, 115, 0.1);
  color: var(--accent);
  font-weight: 900;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setup-chip-grid {
  gap: 10px;
}

.chip-grid.compact {
  margin: 8px 0 14px;
}

.chip-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid rgba(0, 69, 106, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chip-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chip-choice span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip-choice span::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 69, 106, 0.22);
  content: "";
}

.chip-choice:has(input:checked) {
  border-color: rgba(0, 69, 106, 0.45);
  background: #00456a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 69, 106, 0.16);
}

.chip-choice:has(input:checked) span::before {
  background: #48d489;
  box-shadow: 0 0 0 3px rgba(72, 212, 137, 0.18);
}

.chip-choice:hover {
  border-color: rgba(0, 135, 255, 0.42);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  transform: translateY(-1px);
}

.chip-choice:has(input:checked):hover {
  background: #006fae;
  color: #fff;
}

.setup-choice-section {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 12px 28px rgba(0, 69, 106, 0.06);
  overflow: hidden;
}

.setup-choice-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 16px 18px;
  color: var(--text);
  font-weight: 900;
}

.setup-choice-section summary small {
  color: var(--muted);
  font-weight: 800;
}

.setup-choice-section[open] {
  background: rgba(255, 255, 255, 0.58);
}

.setup-choice-section > .chip-grid,
.setup-choice-section > .actions {
  margin: 0 18px 18px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: 8px;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.day-card,
.day-rule-card {
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
}

.day-rule-card summary {
  cursor: pointer;
  font-weight: 900;
}

.day-rule-options {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.compact-actions {
  justify-content: flex-start;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1160px);
    padding-top: 10px;
  }

  .hero {
    flex-direction: column;
    padding: 18px;
  }

  .subscriptions-header,
  .modal-head,
  .competition-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .subscriptions-header,
  .modal-head {
    flex-direction: column;
  }

  .competition-card-actions {
    max-width: none;
    justify-content: stretch;
  }

  .actions {
    justify-content: stretch;
  }

  .actions > * {
    flex: 1 1 100%;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table thead {
    display: none;
  }
}
