/* =============================================
   WEDDING WEBSITE — STYLES
   
   Color palette & design tokens are defined as
   CSS custom properties below. Edit them to
   re-theme the entire site in seconds.
   ============================================= */

/* ----- DESIGN TOKENS ----- */
:root {
  /* EDIT HERO IMAGE PATH HERE */
  --hero-image: url('https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=1920&q=80');

  /* Palette */
  --color-ivory:       #FAF8F5;
  --color-cream:       #F5F0EB;
  --color-champagne:   #F2E8DA;
  --color-warm-white:  #FFFDF9;
  --color-gold:        #C5A55A;
  --color-gold-light:  #D4BA7A;
  --color-gold-dark:   #A68A3E;
  --color-dusty-rose:  #D4A5A5;
  --color-rose-light:  #E8CECE;
  --color-sage:        #A8B5A0;
  --color-sage-light:  #C7D1C0;
  --color-text:        #3B3530;
  --color-text-light:  #6B635A;
  --color-text-muted:  #9B9389;
  --color-white:       #FFFFFF;
  --color-error:       #C0616B;
  --color-success:     #7BA07B;

  /* Typography */
  --font-serif:   'Georgia', 'Times New Roman', 'Palatino', serif;
  --font-sans:    'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-display: var(--font-serif);

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill: 50px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(59,53,48,0.06);
  --shadow-md:  0 4px 16px rgba(59,53,48,0.08);
  --shadow-lg:  0 8px 32px rgba(59,53,48,0.10);
  --shadow-xl:  0 16px 48px rgba(59,53,48,0.12);

  /* Transitions */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --duration:  0.4s;
}

/* ----- RESET & BASE ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-gold-dark);
  text-decoration: none;
  transition: color var(--duration) var(--ease-out);
}

a:hover {
  color: var(--color-gold);
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ----- BUTTONS ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.8rem 2rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
  line-height: 1;
}

.btn:focus-visible {
  outline: 3px solid var(--color-gold-light);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-gold);
  color: var(--color-white);
  border-color: var(--color-gold);
}

.btn-primary:hover {
  background: var(--color-gold-dark);
  border-color: var(--color-gold-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.btn-outline:hover {
  background: var(--color-gold);
  color: var(--color-white);
}

.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

/* =============================================
   LOGIN / HERO VIEW
   ============================================= */
.login-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: var(--space-lg);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(59,53,48,0.25) 0%,
    rgba(59,53,48,0.55) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 520px;
  color: var(--color-white);
  animation: fadeInUp 1s var(--ease-out) both;
}

.hero-prelude {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: var(--space-sm);
}

.hero-names {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.hero-names .amp {
  font-style: italic;
  opacity: 0.7;
  padding: 0 0.15em;
}

.hero-date {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--space-xs);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  opacity: 0.75;
  margin-bottom: var(--space-xl);
}

/* Login form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.login-form input {
  width: 100%;
  max-width: 320px;
  padding: 0.9rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: rgba(255,255,255,0.92);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  text-align: center;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  transition: all var(--duration) var(--ease-out);
}

.login-form input::placeholder {
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.login-form input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 4px rgba(197,165,90,0.25);
}

.login-error {
  font-size: 0.85rem;
  color: var(--color-rose-light);
  min-height: 1.2em;
  transition: opacity 0.3s ease;
}

.login-error:empty {
  opacity: 0;
}

/* =============================================
   DASHBOARD VIEW  (hidden by default)
   ============================================= */
.dashboard-view {
  display: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

body.logged-in .login-view {
  display: none;
}

body.logged-in .dashboard-view {
  display: block;
  opacity: 1;
}

/* ----- NAVIGATION ----- */
.dash-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(250,248,245,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(197,165,90,0.12);
  transition: box-shadow 0.3s ease;
}

.dash-nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-gold);
  letter-spacing: 0.05em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: var(--space-lg);
}

.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-light);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-gold);
  transition: width 0.3s var(--ease-out);
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 110;
  background: var(--color-cream);
  border: 1px solid rgba(197,165,90,0.2);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s ease;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ----- CONTAINER ----- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ----- SECTIONS ----- */
.section {
  padding: var(--space-3xl) 0;
}

.section-overline {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  text-align: center;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  line-height: 1.25;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--color-text-light);
  text-align: center;
  max-width: 480px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

/* ----- WELCOME ----- */
.section-welcome {
  padding-top: calc(var(--space-3xl) + 60px); /* offset for sticky nav */
  background: linear-gradient(to bottom, var(--color-cream) 0%, var(--color-ivory) 100%);
}

.invite-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--color-gold-dark);
  background: var(--color-champagne);
  border: 1px solid var(--color-gold-light);
  border-radius: var(--radius-pill);
  text-align: center;
  margin: var(--space-md) auto 0;
}

.section-welcome .container {
  text-align: center;
}

/* ----- SEATING CARD ----- */
.section-seating {
  background: var(--color-ivory);
}

.seating-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(197,165,90,0.1);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.seating-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold-light), var(--color-gold), var(--color-gold-light));
  border-radius: 2px;
}

.seating-table-number {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--color-gold);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.seating-table-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.seating-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-champagne), transparent);
  margin: var(--space-md) 0;
}

.seating-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.seating-companions {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

.seating-companions li {
  background: var(--color-cream);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--color-text);
  border: 1px solid rgba(197,165,90,0.12);
}

/* ----- VENUE ----- */
.section-venue {
  background: var(--color-cream);
}

.venue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 640px;
  margin: 0 auto;
}

.venue-info-card,
.venue-map-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(197,165,90,0.08);
}

.venue-address {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
}

.venue-notes {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-champagne);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.venue-notes p {
  margin-bottom: var(--space-sm);
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-muted);
  gap: var(--space-sm);
}

.map-placeholder svg {
  opacity: 0.3;
}

.map-placeholder p {
  font-size: 0.85rem;
}

/* ----- SCHEDULE / TIMELINE ----- */
.section-schedule {
  background: var(--color-ivory);
}

.timeline {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-gold-light), var(--color-champagne));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2rem + -4px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 2px solid var(--color-ivory);
}

.timeline-time {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--color-gold-dark);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline-content h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ----- DIETARY / RSVP FORM ----- */
.section-dietary {
  background: var(--color-cream);
}

.dietary-form {
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(197,165,90,0.08);
}

.form-group {
  margin-bottom: var(--space-lg);
  border: none;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  padding: 0;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-ivory);
  border: 1.5px solid var(--color-champagne);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(197,165,90,0.15);
  background: var(--color-white);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239B9389' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

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

/* Radio group */
.radio-group {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-text);
}

.radio-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-champagne);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-gold);
  transform: scale(0);
  transition: transform 0.2s var(--ease-out);
}

.radio-label input:checked ~ .radio-custom {
  border-color: var(--color-gold);
}

.radio-label input:checked ~ .radio-custom::after {
  transform: scale(1);
}

.radio-label input:focus-visible ~ .radio-custom {
  box-shadow: 0 0 0 3px rgba(197,165,90,0.25);
}

.form-success {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-success);
  margin-top: var(--space-md);
  min-height: 1.4em;
  transition: opacity 0.3s ease;
}

.form-success:empty {
  opacity: 0;
}

/* ----- FOOTER ----- */
.site-footer {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--color-champagne);
}

/* ----- TOAST ----- */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: var(--color-white);
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s var(--ease-out);
  z-index: 200;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animate sections as they appear */
.anim-target {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.anim-target.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children appearance */
.anim-target.visible .seating-card,
.anim-target.visible .venue-grid,
.anim-target.visible .dietary-form,
.anim-target.visible .timeline {
  animation: fadeInUp 0.6s var(--ease-out) 0.15s both;
}

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

/* Tablet & below */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250,248,245,0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    z-index: 105;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .dash-nav {
    padding-right: calc(42px + var(--space-lg) + var(--space-md));
  }

  #logout-btn {
    display: none;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .section-welcome {
    padding-top: calc(var(--space-2xl) + 60px);
  }

  .container {
    padding: 0 var(--space-md);
  }

  .seating-card {
    padding: var(--space-xl) var(--space-lg);
  }

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

  .hero-names {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .venue-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
