*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --red: #e11d2a;
  --red-dark: #b01520;
  --ink: #0b0b0c;
  --surface: #151516;
  --surface-raised: #1c1c1e;
  --line: #343437;
  --muted: #aaa9ad;
  --text: #f4f3f5;
  --success: #65c889;
  --danger: #ff7a82;
  --display: 'Oswald', sans-serif;
  --body: 'Inter', sans-serif;
  --accent: 'Rajdhani', sans-serif;
}

html {
  background: var(--ink);
  font-family: var(--body);
  color: var(--text);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red) 10%, transparent), transparent 38rem),
    var(--ink);
}

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

button, a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 72%, white);
  outline-offset: 3px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-panel {
  width: min(100%, 470px);
  padding: clamp(28px, 6vw, 52px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.eyebrow {
  margin: 42px 0 7px;
  color: var(--red);
  font-family: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.auth-intro,
.editor-heading p {
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.auth-form label,
.field {
  color: var(--muted);
  font-family: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ink);
  color: var(--text);
  padding: 12px 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button-primary {
  margin-top: 14px;
  background: var(--red);
  color: #fffafa;
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-quiet {
  margin: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.button-quiet:hover {
  border-color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

.notice {
  margin: 20px 0 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  line-height: 1.5;
}

.notice-error {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
}

.admin-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 12px clamp(20px, 5vw, 72px);
  background: color-mix(in srgb, var(--ink) 94%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(52px, 7vw, 92px) 0 100px;
}

.editor-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.editor-heading .eyebrow {
  margin-top: 0;
}

.editor-heading .button {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 42px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.status-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-row .is-success {
  color: var(--success);
}

.status-row .is-error {
  color: var(--danger);
}

.text-button,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.text-button {
  padding: 8px 0;
  font-family: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-button:hover,
.icon-button:hover {
  color: var(--text);
}

.event-editor {
  display: grid;
  gap: 18px;
}

.event-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
}

.event-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.event-number {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 1.1rem;
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.3;
}

.delete-event {
  margin-left: 6px;
  color: var(--danger);
}

.field-grid {
  display: grid;
  grid-template-columns: 100px 82px 150px minmax(220px, 1fr);
  gap: 18px;
}

.field-time,
.field-location {
  grid-column: span 2;
}

.field-description {
  grid-column: 1 / -1;
}

.empty-state {
  border: 1px dashed var(--line);
  padding: 44px 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 780px) {
  .admin-header,
  .editor-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header {
    padding: 18px 20px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .button,
  .header-actions form {
    flex: 1;
  }

  .header-actions form .button {
    width: 100%;
  }

  .editor-heading .button {
    width: 100%;
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-type,
  .field-title,
  .field-time,
  .field-location,
  .field-description {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .brand span {
    max-width: 12ch;
  }

  .editor-shell {
    width: min(100% - 28px, 1180px);
  }

  .status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .event-row-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-actions {
    width: 100%;
  }

  .delete-event {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

