/* ─── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --color-bg:          #faf9f6;
  --color-surface:     #ffffff;
  --color-border:      #e8e0d8;
  --color-text:        #2d2926;
  --color-text-muted:  #9c8f84;
  --color-rose:        #b5736d;
  --color-rose-light:  #f5e8e7;
  --color-rose-dark:   #8e504a;
  --color-gold:        #c9a96e;
  --color-gold-light:  #f5eedf;
  --color-sage:        #7d9b76;
  --color-sage-light:  #eaf1e8;
  --color-dark:        #2d2926;
  --color-error-bg:    #fdf0ef;
  --color-error-text:  #8e3a34;
  --color-error-border:#e9b4b0;

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Lato', 'Helvetica Neue', Arial, sans-serif;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  --shadow-sm:  0 1px 3px rgba(45,41,38,.06), 0 1px 2px rgba(45,41,38,.04);
  --shadow-md:  0 4px 16px rgba(45,41,38,.08), 0 2px 6px rgba(45,41,38,.05);
  --shadow-lg:  0 12px 40px rgba(45,41,38,.10), 0 4px 12px rgba(45,41,38,.06);
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--color-dark);
  padding: .9rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}

.logo-ampersand {
  color: var(--color-gold);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-username {
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  font-style: italic;
}

.nav-link {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .02em;
  transition: color .15s;
}

.nav-link:hover { color: var(--color-gold); }

.nav-link--cta {
  background: var(--color-rose);
  color: #fff !important;
  padding: .4rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  transition: background .15s;
}

.nav-link--cta:hover { background: var(--color-rose-dark); }

.nav-link--signout {
  color: rgba(255,255,255,.5) !important;
  font-size: .8rem;
}

.nav-link--signout:hover { color: var(--color-rose-light) !important; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-dark);
  padding: 1.5rem;
  margin-top: 4rem;
}

.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }

.footer-heart {
  color: rgba(255,255,255,.45);
  font-family: var(--font-serif);
  font-size: .9rem;
  font-style: italic;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: .65rem 1.75rem;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--color-rose);
  color: #fff;
  box-shadow: 0 4px 14px rgba(181,115,109,.35);
}
.btn--primary:hover {
  background: var(--color-rose-dark);
  box-shadow: 0 6px 18px rgba(181,115,109,.45);
}

.btn--outline {
  background: transparent;
  color: var(--color-rose);
  border: 2px solid var(--color-rose);
}
.btn--outline:hover {
  background: var(--color-rose-light);
}

.btn--ghost {
  background: var(--color-gold-light);
  color: var(--color-dark);
  font-size: .8rem;
  padding: .4rem 1rem;
}
.btn--ghost:hover { background: #eddfc4; }
.btn--copied { background: var(--color-sage-light); color: var(--color-sage); }

.btn--lg  { font-size: 1rem; padding: .85rem 2.25rem; }
.btn--sm  { font-size: .8rem; padding: .45rem 1.1rem; }
.btn--full { width: 100%; }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(201,169,110,.12) 0%, transparent 70%),
    linear-gradient(160deg, #2d2926 0%, #4a3e38 100%);
  color: #fff;
  text-align: center;
  padding: 7rem 1.5rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(201,169,110,.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(181,115,109,.06) 0%, transparent 50%);
}

.hero-decoration {
  position: absolute;
  top: 2rem;
  font-size: 1.5rem;
  color: var(--color-gold);
  opacity: .5;
}
.hero-decoration--left  { left: 2rem; }
.hero-decoration--right { right: 2rem; }

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: .85rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: italic;
  color: var(--color-gold);
}

.hero-subtitle {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  color: rgba(255,255,255,.7);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ─── Features ───────────────────────────────────────────────────────────────── */
.features {
  padding: 5rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: .75rem;
  color: var(--color-dark);
}

.feature-desc {
  color: var(--color-text-muted);
  font-size: .95rem;
  line-height: 1.7;
}

/* ─── Auth / Centered pages ─────────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.auth-card--wide { max-width: 680px; }

.auth-card__header { text-align: center; margin-bottom: 2rem; }

.auth-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: .6rem;
}

.auth-subtitle {
  color: var(--color-text-muted);
  font-size: .95rem;
  line-height: 1.65;
}

/* ─── Role card ──────────────────────────────────────────────────────────────── */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 560px) {
  .role-grid { grid-template-columns: 1fr; }
}

.role-card {
  cursor: pointer;
  display: block;
}

.role-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card__inner {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.role-card:hover .role-card__inner {
  border-color: var(--color-rose);
  background: var(--color-rose-light);
}

.role-card input:checked ~ .role-card__inner {
  border-color: var(--color-rose);
  background: var(--color-rose-light);
  box-shadow: 0 0 0 3px rgba(181,115,109,.2);
}

.role-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.role-card__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.role-card__desc {
  font-size: .875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.auth-form, .wedding-form, .rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-label {
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--color-dark);
}

.form-label em {
  font-weight: 400;
  color: var(--color-text-muted);
  font-style: normal;
}

.form-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-rose);
  box-shadow: 0 0 0 3px rgba(181,115,109,.15);
  background: #fff;
}

.form-input--code {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  letter-spacing: .15em;
  text-align: center;
  text-transform: uppercase;
  padding: 1rem;
}

.form-textarea { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: .8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.required {
  color: var(--color-rose);
  font-weight: 700;
}

.form-section {
  border: none;
  padding: 0;
}

.form-section__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-rose);
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--color-rose-light);
  width: 100%;
  display: block;
}

.form-actions {
  padding-top: .5rem;
}

/* ─── Page centered (form pages not in auth-page) ───────────────────────────── */
.page-centered {
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
}

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.5rem 3rem;
  width: 100%;
  max-width: 700px;
  box-shadow: var(--shadow-lg);
}

.form-card__header {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert--error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-color: var(--color-error-border);
}

.alert--success {
  background: var(--color-sage-light);
  color: #3d6638;
  border-color: #b8d4b4;
}

/* ─── Wedding header ─────────────────────────────────────────────────────────── */
.wedding-header {
  background: linear-gradient(160deg, var(--color-dark) 0%, #4a3e38 100%);
  color: #fff;
  padding: 4rem 1.5rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.wedding-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(201,169,110,.1) 0%, transparent 55%),
    radial-gradient(circle at 70% 50%, rgba(181,115,109,.08) 0%, transparent 55%);
}

.wedding-header > .container { position: relative; z-index: 1; }

.wedding-header__eyebrow {
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1rem;
}

.wedding-header__names {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: .75rem;
}

.wedding-header__date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  margin-bottom: .5rem;
}

.wedding-header__venue {
  color: rgba(255,255,255,.6);
  font-size: .9rem;
}

.venue-address { font-style: italic; }

/* ─── Invite code ────────────────────────────────────────────────────────────── */
.invite-banner {
  background: linear-gradient(135deg, var(--color-gold-light), #fdf6e8);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.invite-banner__label {
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: .5rem;
  font-weight: 700;
}

.invite-code-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
}

.invite-code-text {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--color-dark);
  background: #fff;
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: .4rem 1.2rem;
}

.invite-banner__hint {
  font-size: .85rem;
  color: var(--color-text-muted);
}

/* ─── Stats ──────────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

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

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid transparent;
}

.stat-card--attending { border-top-color: var(--color-sage); }
.stat-card--declining { border-top-color: var(--color-rose); }
.stat-card--plusone   { border-top-color: var(--color-gold); }
.stat-card--total     { border-top-color: var(--color-text-muted); }

.stat-card__number {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: .4rem;
}

.stat-card__label {
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
}

/* ─── Panel ──────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.panel--secondary {
  background: var(--color-bg);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
  flex-wrap: wrap;
}

.panel__title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.panel__count {
  font-size: .8rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ─── Guest table ────────────────────────────────────────────────────────────── */
.guest-table-wrapper {
  overflow-x: auto;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.guest-table thead th {
  background: var(--color-bg);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  padding: .85rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.guest-table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.guest-table tbody tr:last-child td { border-bottom: none; }

.guest-table tbody tr:hover { background: rgba(181,115,109,.03); }

.row--attending { background: rgba(125,155,118,.02); }
.row--declining { background: rgba(181,115,109,.02); }

.guest-name { font-weight: 700; }

.badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
}

.badge--yes {
  background: var(--color-sage-light);
  color: #3d6638;
}

.badge--no {
  background: var(--color-rose-light);
  color: var(--color-rose-dark);
}

.dietary-tag {
  display: inline-block;
  background: var(--color-gold-light);
  color: #7a5c20;
  border-radius: var(--radius-sm);
  padding: .2rem .6rem;
  font-size: .8rem;
}

.note-cell { max-width: 240px; }

.note-text {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: .875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.date-cell { white-space: nowrap; font-size: .8rem; }

.muted { color: var(--color-text-muted); }

/* ─── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.empty-state__text {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ─── Couple message ─────────────────────────────────────────────────────────── */
.couple-message {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
  padding: 1.25rem 1.75rem;
  border-left: 3px solid var(--color-rose);
  margin: 0;
}

.couple-message-card {
  background: var(--color-rose-light);
  border: 1px solid var(--color-rose);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
}

.couple-message-card .couple-message {
  border-left: none;
  border-top: 1px solid rgba(181,115,109,.2);
}

.couple-message-card__label {
  padding: .75rem 1.75rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-rose-dark);
  font-weight: 700;
}

/* ─── RSVP choice ────────────────────────────────────────────────────────────── */
.rsvp-choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 460px) {
  .rsvp-choice-group { grid-template-columns: 1fr; }
}

.rsvp-choice {
  cursor: pointer;
  display: block;
}

.rsvp-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rsvp-choice__icon  {
  display: block;
  font-size: 2rem;
  margin-bottom: .6rem;
}

.rsvp-choice__label {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}

.rsvp-choice > .rsvp-choice__icon,
.rsvp-choice > .rsvp-choice__label {
  /* inner elements are inside label itself if not wrapped */
}

/* We actually need a wrapper so let's style label directly */
.rsvp-choice {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.rsvp-choice:hover {
  border-color: var(--color-rose);
  background: var(--color-rose-light);
}

.rsvp-choice--selected,
.rsvp-choice input:checked ~ * {
  border-color: var(--color-rose) !important;
  background: var(--color-rose-light) !important;
  box-shadow: 0 0 0 3px rgba(181,115,109,.2) !important;
}

/* ─── Guest public list ──────────────────────────────────────────────────────── */
.guest-list-public {
  list-style: none;
  padding: 1rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.guest-list-public__item {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .35rem .9rem;
  font-size: .875rem;
}

.guest-list-public__name { font-weight: 700; }

.guest-list-public__plusone {
  color: var(--color-text-muted);
  font-size: .8rem;
}

/* ─── Dashboard layout ───────────────────────────────────────────────────────── */
.dashboard-body {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.guest-body {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* ─── RSVP form inside panel ─────────────────────────────────────────────────── */
.rsvp-form {
  padding: 1.75rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .auth-card { padding: 2rem 1.25rem; }
  .form-card { padding: 2rem 1.25rem; }
  .invite-banner { flex-direction: column; }
  .invite-code-text { font-size: 1.5rem; }
  .guest-table { font-size: .8rem; }
  .guest-table thead th,
  .guest-table tbody td { padding: .7rem .8rem; }
  .hero { padding: 5rem 1rem 4rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .wedding-header { padding: 3rem 1rem 2.5rem; }
}
