:root {
  --bg: #f3f8f4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #0f131d;
  --muted: #4d5a69;
  --line: rgba(15, 19, 29, 0.1);
  --field-bg: rgba(255, 255, 255, 0.88);
  --field-line: rgba(15, 19, 29, 0.12);
  --primary: #22c55e;
  --primary-deep: #15803d;
  --secondary: #0f131d;
  --shadow: 0 24px 70px rgba(15, 19, 29, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --page-gutter: clamp(14px, 3vw, 32px);
  --panel-padding: clamp(14px, 2vw, 20px);
  --field-height: 36px;
  --button-height: 36px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.24), transparent 30%),
    radial-gradient(circle at top right, rgba(15, 19, 29, 0.18), transparent 26%),
    linear-gradient(135deg, #f7fbf8 0%, #eaf5ee 48%, #dfe8e3 100%);
  transition: background 0.35s ease, color 0.25s ease;
}

body[data-theme="dark"] {
  --surface: rgba(12, 18, 28, 0.84);
  --surface-strong: #101827;
  --text: #eef4fb;
  --muted: #93a4b8;
  --line: rgba(148, 163, 184, 0.16);
  --field-bg: rgba(15, 23, 35, 0.92);
  --field-line: rgba(148, 163, 184, 0.18);
  --secondary: #eef4fb;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(30, 41, 59, 0.58), transparent 32%),
    linear-gradient(135deg, #071018 0%, #0b1220 52%, #101a2a 100%);
}

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

button,
input,
select,
textarea,
.panel {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.page-shell {
  width: min(1180px, calc(100% - (var(--page-gutter) * 2)));
  margin: 0 auto;
  min-height: 100vh;
  padding: 32px var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.22), rgba(15, 19, 29, 0.12));
  border-radius: 50%;
  filter: blur(4px);
}

.eyebrow,
.section-heading__eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-deep);
  font-weight: 800;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.05;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
}

.hero__text {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.hero__highlights,
.hero__stats,
.content-grid,
.registration-form,
.registration-list {
  display: grid;
  gap: 12px;
}

.hero__highlights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.highlight-card,
.stat-card,
.registration-card {
  background: var(--surface-strong);
  border: 1px solid rgba(15, 19, 29, 0.08);
  border-radius: var(--radius-lg);
}

.highlight-card {
  padding: 18px;
}

.highlight-card__label,
.stat-card span,
.registration-card span,
.registration-card__meta,
.registration-card__date,
.form-message {
  color: var(--muted);
}

.highlight-card strong,
.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.02rem;
}

.hero__stats {
  align-content: start;
}

.stat-card {
  padding: 20px;
}

.stat-card strong {
  margin-top: 18px;
  font-size: 2rem;
  font-family: "Space Grotesk", sans-serif;
}

.stat-card--accent {
  background: linear-gradient(135deg, #0f131d 0%, #1c2433 100%);
  color: #fff;
}

.stat-card--accent span {
  color: rgba(255, 255, 255, 0.72);
}

.content-grid {
  grid-template-columns: 1fr;
  max-width: min(780px, 100%);
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

.panel {
  width: 100%;
  padding: var(--panel-padding);
  border-radius: var(--radius-xl);
}

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.section-heading {
  margin-bottom: 10px;
  min-width: 0;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  line-height: 1.08;
  text-wrap: balance;
}

.panel-intro {
  margin: 0 0 14px;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: clamp(0.95rem, 1.6vw, 1rem);
}

.panel-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--primary-deep);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}

.panel-link:hover {
  text-decoration: underline;
}

.theme-toggle {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 19, 29, 0.12);
  border-radius: 100%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.98), rgba(241, 247, 244, 0.96) 58%, rgba(222, 233, 228, 0.9) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 20px rgba(15, 19, 29, 0.08),
    0 0 0 6px rgba(34, 197, 94, 0.08);
}

.theme-toggle:hover {
  transform: translateY(-1px) scale(1.02);
}

.theme-toggle__glow {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 223, 116, 0.28), rgba(34, 197, 94, 0.08) 52%, transparent 76%);
  filter: blur(7px);
}

.theme-toggle__icon-wrap {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: #ffd75e;
  filter: drop-shadow(0 0 8px rgba(255, 215, 94, 0.32));
}

.theme-toggle__icon-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

body[data-theme="dark"] .theme-toggle {
  background: radial-gradient(circle at 50% 30%, rgba(34, 197, 94, 0.12), #09111b 72%);
  border-color: rgba(34, 197, 94, 0.22);
}

body[data-theme="dark"] .theme-toggle__icon-wrap {
  color: #78f5a8;
  filter: drop-shadow(0 0 8px rgba(120, 245, 168, 0.3));
}

.registration-form {
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

.phone-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--field-line);
  background: var(--field-bg);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.phone-input__prefix {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  padding: 0 14px;
  border-right: 1px solid var(--field-line);
  background: rgba(15, 19, 29, 0.04);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

body[data-theme="dark"] .phone-input__prefix {
  background: rgba(255, 255, 255, 0.04);
}

.field-group input,
.field-group select,
.field-group textarea,
.toolbar input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--field-line);
  background: var(--field-bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.phone-input input {
  min-height: 46px;
  padding-left: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.field-group select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus,
.toolbar input:focus {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
  transform: translateY(-1px);
}

.phone-input:focus-within {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
  transform: translateY(-1px);
}

.phone-input input:focus {
  box-shadow: none;
  transform: none;
}

.field-group textarea {
  min-height: 88px;
  resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: var(--muted);
}

.phone-input input::placeholder {
  color: rgba(77, 90, 105, 0.5);
}

body[data-theme="dark"] .phone-input input::placeholder {
  color: rgba(147, 164, 184, 0.46);
}

.field-group input:-webkit-autofill,
.field-group input:-webkit-autofill:hover,
.field-group input:-webkit-autofill:focus,
.field-group textarea:-webkit-autofill,
.field-group textarea:-webkit-autofill:hover,
.field-group textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow:
    0 0 0 1000px var(--field-bg) inset,
    0 0 0 1px var(--field-line) inset;
  transition: background-color 9999s ease-out;
}

.field-group input:-webkit-autofill:focus,
.field-group textarea:-webkit-autofill:focus {
  box-shadow:
    0 0 0 1000px var(--field-bg) inset,
    0 0 0 1px rgba(34, 197, 94, 0.55) inset,
    0 0 0 4px rgba(34, 197, 94, 0.14);
}

.form-actions,
.toolbar,
.registration-card__header {
  display: flex;
  gap: 8px;
}

.form-actions {
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.primary-button,
.ghost-button,
.delete-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.primary-button:hover,
.ghost-button:hover,
.delete-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.delete-button:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
}

.primary-button {
  min-height: 46px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, #7ee787 100%);
  color: #0f131d;
  font-weight: 800;
  flex: 0 0 auto;
}

.ghost-button {
  min-height: 46px;
  padding: 10px 18px;
  background: rgba(15, 19, 29, 0.06);
  color: var(--text);
  font-weight: 700;
  flex: 0 0 auto;
}

body[data-theme="dark"] .ghost-button {
  background: rgba(255, 255, 255, 0.08);
}

.ghost-button--danger,
.delete-button {
  color: #0f131d;
  background: rgba(34, 197, 94, 0.14);
}

body[data-theme="dark"] .ghost-button--danger,
body[data-theme="dark"] .delete-button {
  color: var(--text);
  background: rgba(34, 197, 94, 0.18);
}

.form-message {
  min-height: 18px;
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.form-message.is-success {
  color: var(--primary-deep);
}

.form-message.is-error {
  color: #b42318;
}

.toolbar {
  align-items: center;
  margin-bottom: 18px;
}

.toolbar input {
  flex: 1;
}

.registration-list {
  min-height: 320px;
}

.registration-empty {
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(15, 19, 29, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.registration-card {
  padding: 18px;
}

.registration-card__header {
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.registration-card__name {
  margin: 0;
  font-size: 1.16rem;
}

.registration-card__meta {
  margin: 6px 0 0;
}

.registration-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.registration-card__grid p,
.registration-card__note,
.registration-card__date {
  margin: 0;
}

.registration-card__grid span,
.registration-card__note,
.registration-card__date {
  display: block;
  font-size: 0.92rem;
}

.registration-card__grid strong {
  display: block;
  margin-top: 4px;
}

.registration-card__note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 19, 29, 0.08);
  line-height: 1.6;
}

.registration-card__date {
  margin-top: 12px;
  font-size: 0.84rem;
}

.delete-button {
  padding: 10px 14px;
  font-weight: 700;
}

@media (max-width: 900px) {
  :root {
    --panel-padding: 18px;
  }

  .content-grid {
    max-width: 100%;
  }

  .panel-intro {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    min-height: auto;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    align-items: stretch;
  }

  .panel {
    padding: 18px;
  }

  .panel-toolbar {
    align-items: flex-start;
  }

  .theme-toggle {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }

  .form-row,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button {
    flex: 1 1 100%;
  }
}

@media (max-width: 560px) {
  :root {
    --page-gutter: 10px;
    --panel-padding: 16px;
    --field-height: 46px;
    --button-height: 46px;
  }

  .panel-toolbar {
    gap: 12px;
  }

  .section-heading h2 {
    font-size: clamp(1.45rem, 8vw, 1.85rem);
  }

  .section-heading__eyebrow {
    margin-bottom: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  .panel-intro {
    margin-bottom: 12px;
    font-size: 0.92rem;
  }

  .panel-link {
    font-size: 0.85rem;
  }

  .field-group {
    gap: 7px;
  }

  .field-group label {
    font-size: 0.89rem;
  }

  .field-group input,
  .field-group select,
  .field-group textarea,
  .phone-input {
    border-radius: 12px;
  }

  .field-group textarea {
    min-height: 78px;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: min(100% - 12px, 1180px);
  }

  .panel {
    border-radius: 22px;
  }

  .theme-toggle {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .theme-toggle__icon-wrap {
    width: 16px;
    height: 16px;
  }

  .field-group input,
  .field-group select,
  .field-group textarea {
    padding-inline: 12px;
  }

  .phone-input__prefix {
    padding-inline: 12px;
  }
}
