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

:root {
  --black: #0a0a0f;
  --royal: #1d4ed8;
  --royal-dark: #17399f;
  --royal-bright: #4d78ff;
  --royal-light: #eef2fd;
  --white: #ffffff;
  --off-white: #f6f7fb;
  --ink: #12131a;
  --muted: #5b5f6e;
  --error: #dc2626;
  --error-dark: #a91e1e;
  --error-bg: #fdecec;

  --border-w: 3px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-offset: 4px;
  --shadow-offset-lg: 6px;
  --shadow: var(--shadow-offset) var(--shadow-offset) 0 0 var(--black);
  --shadow-hover: var(--shadow-offset-lg) var(--shadow-offset-lg) 0 0 var(--black);
  --shadow-flat: 0 0 0 0 var(--black);
  --shadow-sm: 2px 2px 0 0 var(--black);

  --transition: 120ms ease-out;
  --focus-ring: 0 0 0 3px rgba(29, 78, 216, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  background: var(--off-white);
  color: var(--ink);
  line-height: 1.6;
}

.icon {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

a {
  color: var(--royal);
  font-weight: 600;
  transition: color var(--transition);
}

a:hover {
  color: var(--royal-dark);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---------- Hero ---------- */

header.hero {
  position: relative;
  background: var(--royal);
  color: var(--white);
  padding: 52px 20px 40px;
  text-align: center;
  border-bottom: var(--border-w) solid var(--black);
}

header.hero h1 {
  font-family: 'Righteous', 'Poppins', sans-serif;
  font-weight: 400;
  margin: 0 0 16px;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.01em;
  text-shadow: 3px 3px 0 var(--black);
}

header.hero .subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.92;
  margin-bottom: 8px;
}

header.hero .event-meta {
  margin-top: 4px;
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

header.hero .event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--white);
  background: var(--black);
  border: 2px solid var(--white);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
}

header.hero .event-meta .icon {
  color: var(--royal-bright);
}

header.hero .event-meta a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--royal-bright);
  text-underline-offset: 3px;
}

header.hero .event-meta a:hover {
  color: var(--royal-bright);
}

header.hero .event-meta a:focus-visible {
  outline: 2px solid var(--royal-bright);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Card ---------- */

.card {
  background: var(--white);
  border: var(--border-w) solid var(--black);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 0 var(--black);
  padding: 28px;
  margin-top: 32px;
  position: relative;
}

h2 {
  font-family: 'Righteous', 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
  margin: 0 0 16px;
  color: var(--black);
}

fieldset {
  border: 2.5px solid var(--black);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 0 0 20px;
}

legend {
  padding: 2px 10px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--royal);
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.field {
  margin-bottom: 18px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 2.5px solid var(--black);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--ink);
  transition: box-shadow var(--transition), transform var(--transition);
}

textarea {
  min-height: unset;
}

input:hover,
textarea:hover,
select:hover {
  box-shadow: var(--shadow-sm);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 3px 3px 0 0 var(--royal);
  transform: translate(-1px, -1px);
}

/* ---------- Chip-style radio selectors ---------- */

.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2.5px solid var(--black);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

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

.chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 var(--black);
}

.chip:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-flat);
}

.chip:has(input:focus-visible),
.chip.is-focused {
  outline: 3px solid var(--royal);
  outline-offset: 2px;
}

.chip:has(input:checked),
.chip.is-checked {
  background: var(--royal);
  border-color: var(--black);
  color: #fff;
}

.guest-block .chip {
  font-size: 0.88rem;
  padding: 9px 16px;
}

/* ---------- Guests ---------- */

.guest-block {
  border: 2.5px solid var(--black);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  background: var(--royal-light);
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.guest-block.has-error {
  border-color: var(--error);
  box-shadow: 3px 3px 0 0 var(--error);
}

.guest-block .guest-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Righteous', 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--royal-dark);
  margin-bottom: 12px;
}

.remove-guest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 2px solid var(--black);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 10px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.remove-guest:hover {
  color: var(--white);
  background: var(--error);
  border-color: var(--black);
}

.remove-guest:active {
  transform: scale(0.95);
}

.remove-guest:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

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

button:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 2px;
}

button.secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: var(--white);
  border: 2.5px solid var(--black);
  color: var(--black);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

button.secondary:hover {
  background: var(--royal-light);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 var(--black);
}

button.secondary:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-flat);
}

button.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--royal);
  border: var(--border-w) solid var(--black);
  color: white;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.08rem;
  width: 100%;
  box-shadow: var(--shadow);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

button.primary:hover:not(:disabled) {
  background: var(--royal-dark);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

button.primary:active:not(:disabled) {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: var(--shadow-flat);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Total bar ---------- */

.total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--black);
  color: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 2.5px solid var(--black);
  margin: 24px 0;
  font-weight: 700;
  gap: 12px;
  flex-wrap: wrap;
}

.total-bar .amount {
  font-size: 1.6rem;
  font-family: 'Righteous', 'Poppins', sans-serif;
  color: var(--royal-bright);
  font-variant-numeric: tabular-nums;
}

/* ---------- Messages ---------- */

.error {
  color: var(--error-dark);
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
  font-weight: 600;
}

.form-message {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  display: none;
  font-weight: 600;
  background: var(--error-bg);
  border: 2.5px solid var(--error);
  color: var(--error-dark);
}

/* ---------- Confirmation ---------- */

#confirmation {
  text-align: center;
  padding: 8px 0;
}

#confirmation .success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--royal);
  color: var(--white);
  border: 2.5px solid var(--black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

#confirmation .success-icon .icon {
  width: 30px;
  height: 30px;
}

#confirmation .amount {
  font-size: 2.3rem;
  font-family: 'Righteous', 'Poppins', sans-serif;
  color: var(--royal-dark);
  font-weight: 400;
  margin: 10px 0;
  font-variant-numeric: tabular-nums;
}

.order-number {
  display: inline-block;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 0.95em;
  letter-spacing: 0.03em;
  background: var(--royal-light);
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

.pay-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  background: var(--black);
  color: white;
  border: 2.5px solid var(--black);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pay-link:hover {
  color: white;
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.pay-link:active {
  transform: translate(var(--shadow-offset), var(--shadow-offset));
  box-shadow: var(--shadow-flat);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.hint a,
#bankTransferToggle {
  color: var(--royal-dark);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}

.hint a:hover,
#bankTransferToggle:hover {
  border-color: var(--royal-dark);
}

.bank-details {
  margin-top: 12px;
  text-align: left;
  background: var(--royal-light);
  border: 2.5px solid var(--black);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.bank-table {
  width: 100%;
}

.bank-table th {
  background: none;
  width: 40%;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--black);
}

.bank-table td {
  font-weight: 700;
  border-bottom: 1px solid var(--black);
  font-variant-numeric: tabular-nums;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 40px;
  font-weight: 600;
}

/* ---------- Admin table ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--black);
  vertical-align: top;
}

th {
  background: var(--black);
  color: var(--white);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--royal-light);
}

td:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill.meat { background: var(--black); color: var(--white); }
.pill.vegetarian { background: var(--white); color: var(--royal-dark); border-color: var(--royal); }
.pill.special { background: var(--royal); color: var(--white); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat {
  background: var(--white);
  border: 2.5px solid var(--black);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
}

.stat .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--royal);
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .wrap {
    padding: 0 14px 60px;
  }
  header.hero {
    padding: 44px 16px 34px;
  }
  .card {
    padding: 20px;
    box-shadow: 6px 6px 0 0 var(--black);
  }
  fieldset {
    padding: 16px 14px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar > div {
    flex-wrap: wrap;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
