:root {
  --bg: #0f1411;
  --panel: rgba(18, 24, 20, 0.9);
  --panel-2: rgba(210, 224, 214, 0.08);
  --text: rgba(245, 248, 244, 0.96);
  --muted: rgba(225, 233, 226, 0.78);
  --faint: rgba(201, 213, 204, 0.7);
  --border: rgba(173, 191, 177, 0.45);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --accent: #84a98c;
  --accent-2: #cad2c5;
  --good: #7fb685;
  --warn: #e0a96d;
  --bad: #c4665c;
  --radius: 18px;
  --radius-sm: 12px;
  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Light theme overrides */
html[data-theme="light"] {
  --bg: #f5f7f2;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-2: rgba(187, 200, 189, 0.18);
  --text: rgba(28, 34, 29, 0.94);
  --muted: rgba(72, 84, 75, 0.8);
  --faint: rgba(115, 130, 119, 0.75);
  --border: rgba(170, 187, 176, 0.7);
  --shadow: 0 18px 40px rgba(15, 20, 18, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(950px 550px at 10% 0%, rgba(132, 169, 140, 0.18), transparent 55%),
    radial-gradient(850px 520px at 90% 10%, rgba(202, 210, 197, 0.25), transparent 55%),
    var(--bg);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.skip-link:focus {
  left: 10px;
  z-index: 999;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 45%);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand__logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
  color: white;
}

.brand__title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.nav__item {
  all: unset;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav__item:hover {
  background: var(--panel);
  border-color: var(--border);
  transform: translateY(-1px);
}

.nav__item[aria-current="page"] {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(56, 189, 248, 0.14));
  border-color: rgba(124, 92, 255, 0.3);
}

.nav__icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.flag {
  width: 18px;
  height: 14px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.flag--ph {
  background:
    linear-gradient(to bottom, #0038a8 0 50%, #ce1126 50% 100%),
    linear-gradient(to right bottom, transparent 50%, white 50%);
}

.flag--de {
  background:
    linear-gradient(to bottom, #000000 0 33.333%, #dd0000 33.333% 66.666%, #ffce00 66.666% 100%);
}

.flag--it {
  background:
    linear-gradient(
      to right,
      #008c45 0 33.333%,
      #ffffff 33.333% 66.666%,
      #cd212a 66.666% 100%
    );
}

.nav__label {
  font-weight: 600;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
}

.content {
  padding: 18px 20px 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--muted);
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-color: rgba(124, 92, 255, 0.35);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(56, 189, 248, 0.12));
}

.ghost-btn {
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: background 120ms ease, transform 120ms ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
}

.panel--active {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.lead {
  margin: 10px 0 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 70ch;
}

.p {
  margin: 0 0 10px 0;
  color: var(--muted);
  line-height: 1.7;
}

.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  align-items: start;
}

.hero__cta {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.grid {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.grid--2 {
  grid-template-columns: 1fr 1fr;
}

.hero-card {
  border-radius: var(--radius);
  border: 1px solid rgba(124, 92, 255, 0.25);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(56, 189, 248, 0.1));
  padding: 16px;
}

.hero-card__title {
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.feature-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.feature-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.2);
}

.hero-card__note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--faint);
  font-size: 12px;
}

.tiny {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.list {
  margin: 10px 0 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.callout {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
  color: var(--muted);
}

.code {
  margin: 10px 0 0 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
}

.pill--active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(56, 189, 248, 0.14);
}

.trainer {
  display: grid;
  gap: 12px;
}

.trainer__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.trainer__label {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.trainer__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot-sep {
  opacity: 0.65;
}

.trainer-card {
  border: 1px solid rgba(124, 92, 255, 0.25);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(56, 189, 248, 0.08));
  border-radius: var(--radius);
  padding: 14px;
  min-height: 160px;
}

.trainer-card__prompt {
  margin-bottom: 8px;
}

.trainer-card__front {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trainer-card__back {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.trainer__controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.trainer__grade {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-btn,
.secondary-btn,
.grade-btn {
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  user-select: none;
}

.primary-btn {
  color: white;
  border-color: rgba(124, 92, 255, 0.35);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(56, 189, 248, 0.7));
}

.secondary-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.grade-btn {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.primary-btn:hover,
.secondary-btn:hover,
.grade-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.typing__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.typing__feedback {
  margin-top: 8px;
}

.label {
  display: inline-block;
  margin: 10px 0 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.input:focus {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.textarea {
  resize: vertical;
}

.multiple__choices {
  display: grid;
  gap: 8px;
}

.choice-btn {
  all: unset;
  cursor: pointer;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.choice-btn[data-state="correct"] {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}

.choice-btn[data-state="wrong"] {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}

.menu {
  display: grid;
  gap: 10px;
}

.menu__item {
  all: unset;
  cursor: pointer;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.menu__item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.menu__item--accent {
  border-color: rgba(244, 114, 182, 0.35);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.14), rgba(124, 92, 255, 0.12));
}

.menu__title {
  font-weight: 800;
  margin-bottom: 4px;
}

.wedding-view {
  display: none;
}

.wedding-view--active {
  display: block;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.timeline__row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.timeline__time {
  font-weight: 900;
  color: var(--text);
}

.timeline__text {
  color: var(--muted);
}

.gate {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.gate__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.gate__msg {
  margin-top: 8px;
}

.form {
  margin-top: 12px;
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form__actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form__msg {
  margin-top: 10px;
}

.form__hint {
  margin-top: 10px;
  opacity: 0.9;
}

/* Guest rows (first/last name + remove) */
.guest-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 6px;
}

.guest-row:first-child {
  margin-top: 0;
}

/* Wedding guest names: small "+" button */
.add-guest-btn {
  padding: 4px 9px;
  border-radius: 999px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.guest-remove-btn {
  padding: 4px 9px;
  border-radius: 999px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* RSVP toggle styling */
.choice-toggle {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.choice-toggle__option {
  position: relative;
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: stretch;
  cursor: pointer;
}

.choice-toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-toggle__label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease,
    box-shadow 120ms ease, color 120ms ease;
}

.choice-toggle__icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.4);
  font-size: 14px;
}

.choice-toggle__text {
  font-weight: 600;
}

.choice-toggle__option:hover .choice-toggle__label {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.choice-toggle__input:focus-visible + .choice-toggle__label {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
}

.choice-toggle__input:checked + .choice-toggle__label {
  background: linear-gradient(
    135deg,
    rgba(244, 114, 182, 0.18),
    rgba(124, 92, 255, 0.16)
  );
  border-color: rgba(244, 114, 182, 0.65);
  color: var(--text);
}

.footer {
  margin-top: 16px;
  text-align: center;
  padding: 10px 0 0;
  color: var(--faint);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .grid--2 {
    grid-template-columns: 1fr;
  }

  .form__grid {
    grid-template-columns: 1fr;
  }
}

