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

:root {
  --blue: #0a2351;
  --blue-dark: #061a3e;
  --blue-soft: #edf4ff;
  --gold: #d4a233;
  --gold-light: #f5d98a;
  --paper: #ffffff;
  --ink: #242833;
  --muted: #6d7482;
  --line: #dfe4ec;
  --ok: #16794c;
  --maybe: #9a6a00;
  --no: #aa2b24;
  --shadow: 0 22px 60px rgba(30, 43, 67, 0.14);
  --font: "Assistant", Arial, "Noto Sans Hebrew", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(175deg, #081d45 0%, #0c2d6b 45%, #071a3a 100%);
  font-family: var(--font);
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* ==============================
   GUEST VIEW
   ============================== */

.app-shell {
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: 100vh;
}

.guest-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 40px;
  background: linear-gradient(175deg, #081d45 0%, #0c2d6b 40%, #071a3a 100%);
  border-radius: 0;
  overflow: hidden;
}

/* Hero Header */
.hero-header {
  position: relative;
  width: 100%;
  padding: 48px 20px 28px;
  text-align: center;
  overflow: hidden;
}

.hero-header h1 {
  color: #fff;
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 10px;
}

.hero-header p {
  color: rgba(255,255,255,0.88);
  font-size: 1.15rem;
  font-weight: 700;
}

/* Confetti dots */
.confetti-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.dot-1 { top: 30px; right: 25px; width: 8px; height: 8px; }
.dot-2 { top: 60px; right: 60px; width: 5px; height: 5px; background: rgba(255,255,255,0.5); }
.dot-3 { top: 45px; left: 30px; width: 7px; height: 7px; background: var(--gold-light); }
.dot-4 { top: 80px; left: 55px; width: 4px; height: 4px; background: rgba(255,255,255,0.4); }
.dot-5 { bottom: 20px; right: 40px; width: 5px; height: 5px; background: var(--gold-light); }

.star-deco {
  position: absolute;
  color: var(--gold);
  font-size: 2rem;
  line-height: 1;
}
.star-1 { top: 22px; left: 18px; font-size: 2.4rem; }
.star-2 { top: 55px; right: 22px; font-size: 1.4rem; color: var(--gold-light); }

/* Phone-shaped white card */
.phone-card {
  width: min(calc(100% - 28px), 400px);
  margin: -10px auto 0;
  padding: 28px 16px 0;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Photo Section */
.photo-section {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0;
  margin-bottom: 14px;
}

.photo-frame {
  position: relative;
  width: 100%;
  max-width: 340px;
  border-radius: 16px;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.photo-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.photo-deco {
  position: absolute;
  z-index: 2;
}

.deco-heart {
  top: -8px;
  right: -8px;
  color: var(--gold);
  font-size: 1.6rem;
}

.deco-dot-1 {
  bottom: 10px;
  left: -10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.deco-dot-2 {
  top: 30px;
  right: -12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(100,130,180,0.4);
}

.deco-dot-3 {
  bottom: -6px;
  right: 40px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-light);
}

/* Event Info Row */
.event-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--blue-dark);
  font-size: 0.88rem;
  font-weight: 700;
  flex-wrap: wrap;
}

.info-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.info-icon {
  font-size: 0.9rem;
}

.info-sep {
  color: var(--line);
}

/* Schedule Row */
.schedule-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  flex-wrap: wrap;
}

.sch-sep {
  color: var(--line);
}

/* RSVP Card */
.rsvp-card {
  width: 100%;
  margin: 0 auto;
  padding: 10px 4px 24px;
  background: transparent;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.name-field {
  display: grid;
  gap: 6px;
  color: var(--blue-dark);
  font-weight: 800;
  margin-bottom: 6px;
}

.name-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff;
}

.rsvp-title {
  text-align: center;
  color: var(--blue-dark);
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 16px;
}

/* RSVP Choices */
.rsvp-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.rsvp-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 12px 8px;
  border: 2px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: all 200ms ease;
  text-align: center;
  background: #fff;
}

.rsvp-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1.2;
}

.choice-check, .choice-sad {
  font-size: 1.1rem;
  opacity: 0.6;
}

.rsvp-choice:has(input:checked).choice-yes {
  background: linear-gradient(150deg, #0c2d6b, #061a3e);
  border-color: var(--blue-dark);
  box-shadow: 0 10px 28px rgba(6,26,62,0.25);
}

.rsvp-choice:has(input:checked).choice-yes .choice-label,
.rsvp-choice:has(input:checked).choice-yes .choice-check {
  color: #fff;
  opacity: 1;
}

.rsvp-choice:has(input:checked).choice-no {
  background: #fff5f5;
  border-color: var(--no);
}

.rsvp-choice:has(input:checked).choice-no .choice-label {
  color: var(--no);
}

.rsvp-choice:has(input:checked).choice-no .choice-sad {
  opacity: 1;
}

/* Count Section */
.count-section {
  text-align: center;
  margin-bottom: 18px;
}

.count-label {
  color: var(--blue-dark);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.guest-stepper {
  display: inline-grid;
  grid-template-columns: 52px 80px 52px;
  align-items: center;
  gap: 0;
}

.step-btn {
  width: 52px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  font-size: 1.6rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 150ms ease;
  line-height: 1;
}

.step-btn:hover {
  background: var(--blue-soft);
}

.guest-stepper input {
  width: 80px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  border-inline: 0;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue-dark);
  background: #fff;
  -moz-appearance: textfield;
}

.guest-stepper input::-webkit-outer-spin-button,
.guest-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.count-hint {
  margin-top: 6px;
  color: #8fa4ca;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(150deg, #0c2d6b, #061a3e);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(6,26,62,0.3);
}

.heart-icon {
  color: var(--gold);
  font-size: 1.2rem;
}

.form-message {
  min-height: 24px;
  margin-top: 10px;
  text-align: center;
  font-weight: 800;
  color: var(--blue-dark);
}

.form-message.success { color: var(--ok); }
.form-message.error { color: var(--no); }

/* Success state */
.rsvp-card.submitted .rsvp-choices,
.rsvp-card.submitted .count-section,
.rsvp-card.submitted .submit-btn,
.rsvp-card.submitted .rsvp-title {
  display: none;
}

/* Count hidden when "no" selected */
.count-section.hidden {
  display: none;
}

/* ==============================
   ADMIN VIEW
   ============================== */

.admin-layout {
  padding: 0;
  background: #f4f6fa;
  min-height: 100vh;
}

.admin-layout .app-shell { width: 100%; }

.gate {
  max-width: 380px;
  margin: 60px auto;
  padding: 32px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  text-align: center;
}

.gate h1 {
  font-size: 1.5rem;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

.lead {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.gate-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--blue-dark);
  font-weight: 800;
  text-align: right;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
}

textarea { resize: vertical; }

button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(38,59,98,0.1);
}

.primary-button {
  min-height: 50px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(150deg, #0b3471, #041a42);
  font-size: 1.1rem;
  font-weight: 700;
}

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

.dashboard {
  padding: 20px 16px 40px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dash-title {
  text-align: center;
  color: var(--blue-dark);
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stats-grid article {
  padding: 12px 6px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stats-grid span {
  display: block;
  color: var(--blue-dark);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.stats-grid strong {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 4px;
}

.stat-yes span { color: var(--ok); }
.stat-no span { color: var(--no); }
.stat-people { background: var(--blue-soft) !important; }
.stat-people span { color: var(--blue); }

.dash-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.dash-actions button {
  flex: 1;
  padding: 0 12px;
  font-size: 0.85rem;
  min-height: 40px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.filters input {
  min-height: 42px;
}

.filters select {
  min-height: 42px;
  width: auto;
  min-width: 90px;
}

/* Guest cards (mobile-friendly) */
.guest-cards {
  display: grid;
  gap: 8px;
}

.guest-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.guest-card-name {
  font-weight: 800;
  color: var(--blue-dark);
  font-size: 1.05rem;
}

.guest-card-group {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.guest-card-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-yes { color: var(--ok); background: #e8f6ef; }
.status-maybe { color: var(--maybe); background: #fff6dc; }
.status-no { color: var(--no); background: #fff0ef; }
.status-opened, .status-pending { color: var(--blue-dark); background: var(--blue-soft); }

.guest-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.guest-card-actions a, .guest-card-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.empty-cards {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

h1, h2, h3, p { margin-top: 0; }

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 980px) {
  .tools-panel { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .invitee-form { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .dashboard-head { flex-direction: column; align-items: stretch; }
  .filters { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 420px) {
  .hero-header h1 { font-size: 2.4rem; }
  .hero-header p { font-size: 1.05rem; }
  .name-ribbon { font-size: 1.3rem; }
  .rsvp-card { padding: 20px 16px 18px; }
  .event-info-row { font-size: 0.82rem; }
}
