/* ==========================================================================
   themes.css — Invitación Luli & Lucho
   Paleta: blanco de fondo + verde, verde seco, chocolate y beige.
   Para cambiar colores o tipografías, editá solo las variables de :root.
   ========================================================================== */

:root {
  /* Colores */
  --blanco:      #FFFFFF;
  --crema:       #F8F4ED;   /* fondo alternado de secciones */
  --beige:       #E7D9C1;
  --beige-osc:   #C9B28E;
  --verde:       #6B7A4A;   /* verde oliva principal */
  --verde-seco:  #A4AE86;   /* verde seco / salvia */
  --verde-osc:   #47532F;
  --chocolate:   #4A2C1E;
  --texto:       #3D2B20;
  --muted:       #8A7A6C;
  --error:       #A6402E;
  --ok:          #56703A;

  /* Tipografías */
  --f-script:  'Pinyon Script', cursive;
  --f-serif:   'Cormorant Garamond', Georgia, serif;
  --f-sans:    'Jost', system-ui, sans-serif;

  /* Medidas */
  --radius: 14px;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(74, 44, 30, .05), 0 12px 32px -12px rgba(74, 44, 30, .18);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blanco);
  color: var(--texto);
  font: 300 17px/1.7 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--verde); }
strong { font-weight: 500; color: var(--chocolate); }
em { font-family: var(--f-serif); font-style: italic; font-size: 1.12em; color: var(--verde); }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 500; color: var(--chocolate); margin: 0; line-height: 1.15; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 3px; }

.eyebrow {
  font: 500 .78rem/1 var(--f-sans);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--verde);
  margin: 0 0 .9rem;
}

/* Ramita de olivo */
.ramita { width: 150px; height: 38px; color: var(--verde-seco); display: block; margin: 1rem auto; }
.ramita .aceitunas { fill: var(--verde-osc); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.8rem;
  border: 1px solid var(--verde);
  border-radius: 999px;
  background: var(--verde);
  color: var(--blanco);
  font: 400 .82rem/1 var(--f-sans);
  letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .25s, color .25s, transform .25s, box-shadow .25s;
}
.btn:hover { background: var(--verde-osc); border-color: var(--verde-osc); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-ghost { background: transparent; color: var(--verde); }
.btn-ghost:hover { background: var(--verde); color: var(--blanco); }

/* ---------- Navegación ---------- */
.topnav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; gap: .2rem; padding: .35rem;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--beige); border-radius: 999px;
  box-shadow: 0 6px 20px -10px rgba(74, 44, 30, .25);
}
.topnav a {
  padding: .45rem .95rem; border-radius: 999px;
  font: 400 .72rem/1 var(--f-sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--chocolate); text-decoration: none; white-space: nowrap;
  transition: background .2s;
}
.topnav a:hover { background: var(--crema); }
.topnav .nav-cta { background: var(--verde); color: var(--blanco); }
.topnav .nav-cta:hover { background: var(--verde-osc); }

/* ---------- Portada ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 3rem;
  max-width: var(--maxw); margin: 0 auto;
  padding: 6.5rem 1.5rem 4rem;
  position: relative;
}
.hero::before { /* marco tipo tarjeta */
  content: ""; position: fixed; inset: 10px; pointer-events: none; z-index: 40;
  border: 1px solid var(--beige); border-radius: 6px;
}
.hero-text { text-align: center; }
.names {
  font-family: var(--f-script); font-weight: 400;
  font-size: clamp(3.6rem, 9vw, 6.2rem); line-height: .95;
  color: var(--chocolate);
  display: flex; flex-direction: column; align-items: center;
}
.names .amp { font-size: .55em; color: var(--verde-seco); margin: .1em 0; }
.hero-ramita { width: 190px; height: 48px; }
.hero-date {
  font-family: var(--f-serif); font-size: 1.45rem; color: var(--chocolate); margin: .4rem 0 1.4rem;
}
.hero-date span { font-family: var(--f-sans); font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.hero-photo {
  margin: 0; position: relative;
  aspect-ratio: 4 / 5; max-height: 78vh; justify-self: center; width: 100%; max-width: 430px;
}
.hero-photo::before { /* arco desplazado de fondo */
  content: ""; position: absolute; inset: -14px 14px 14px -14px;
  border: 1px solid var(--verde-seco); border-radius: 999px 999px 18px 18px;
}
.hero-photo img {
  position: relative; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%;
  border-radius: 999px 999px 18px 18px;
  box-shadow: var(--shadow);
}

/* Cuenta regresiva */
.countdown { display: flex; justify-content: center; gap: .7rem; margin: 0 0 1.8rem; }
.countdown div {
  min-width: 70px; padding: .7rem .4rem .55rem;
  background: var(--crema); border: 1px solid var(--beige); border-radius: 12px;
}
.countdown b { display: block; font: 500 1.75rem/1 var(--f-serif); color: var(--chocolate); }
.countdown span { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* ---------- Intro + galería ---------- */
.intro { max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 6rem; }
.quote {
  font: italic 400 clamp(1.4rem, 3.2vw, 2rem)/1.45 var(--f-serif);
  color: var(--chocolate); text-align: center; max-width: 720px; margin: 0 auto 3.5rem;
}
.quote em { font-size: 1em; }
.gallery {
  display: grid; gap: 14px;
  grid-template-columns: 1.15fr .85fr 1fr;
  grid-template-rows: 230px 230px;
  grid-template-areas: "a b c" "d b c";
}
.gallery .g { margin: 0; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.gallery .g:hover img { transform: scale(1.04); }
.g1 { grid-area: a; } .g2 { grid-area: b; } .g3 { grid-area: c; } .g4 { grid-area: d; }
.g2 img { object-position: 50% 30%; }
.g3 img { object-position: 45% 50%; }

/* ---------- Secciones ---------- */
.section { padding: 6rem 1.5rem; }
.section.alt { background: var(--crema); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(2.4rem, 5.5vw, 3.4rem); }
.section-head .ramita { margin: .6rem auto 0; }
.lead { margin: 1.4rem 0 0; }
.deadline { display: inline-block; margin-top: .6rem; font-weight: 400; color: var(--verde-osc); }

/* Evento */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 1.5rem; }
.card {
  background: var(--blanco); border: 1px solid var(--beige); border-radius: var(--radius);
  padding: 2.4rem 1.6rem 2rem; text-align: center; box-shadow: var(--shadow); position: relative;
}
.card::after { content: ""; position: absolute; inset: 7px; border: 1px solid var(--crema); border-radius: 10px; pointer-events: none; }
.card .icon { width: 46px; height: 46px; color: var(--verde); margin-bottom: .6rem; }
.card h3 { font-size: 1.9rem; }
.card .time { font: 500 1.05rem/1 var(--f-sans); letter-spacing: .2em; color: var(--verde); margin: .7rem 0 .9rem; }
.card p { margin: 0; }
.map {
  max-width: 704px; margin: 2rem auto 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--beige); box-shadow: var(--shadow); height: 300px;
}
.map iframe { width: 100%; height: 100%; border: 0; filter: sepia(.25) saturate(.8); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2rem; }

/* Dress code */
.dress { max-width: 560px; margin: 0 auto; text-align: center; }
.swatches { display: flex; justify-content: center; flex-wrap: wrap; gap: .7rem; margin: 2rem 0; }
.swatches span {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 3px var(--blanco), 0 0 0 1px var(--beige);
}
.reserved-title { margin: .4rem 0 1rem; }
.reserved-list { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: .7rem; max-width: 420px; text-align: left; }
.reserved-list li {
  display: flex; align-items: center; gap: 1rem;
  background: var(--crema); border: 1px solid var(--beige); border-radius: 12px; padding: .8rem 1rem;
}
.reserved-list strong { display: block; font-family: var(--f-serif); font-size: 1.3rem; font-weight: 600; line-height: 1.1; }
.reserved-list small { color: var(--muted); font-size: .88rem; }
.sw { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--c); position: relative; box-shadow: inset 0 0 0 3px var(--blanco), 0 0 0 1px var(--beige-osc); }
.sw.no::after {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
  background: var(--error); transform: rotate(45deg); border-radius: 2px;
}

/* ---------- Formulario RSVP ---------- */
.rsvp { max-width: 720px; margin: 0 auto; }
.persona, .contacto {
  border: 1px solid var(--beige); border-radius: var(--radius);
  background: var(--blanco); padding: 1.6rem 1.5rem .6rem; margin: 0 0 1.1rem;
  position: relative; box-shadow: var(--shadow);
  animation: pop .35s ease;
}
.persona.out { opacity: 0; transform: scale(.97); transition: .2s; }
.persona legend, .contacto legend {
  padding: .25rem .9rem; border-radius: 999px; background: var(--verde); color: var(--blanco);
  font: 400 .72rem/1.4 var(--f-sans); letter-spacing: .18em; text-transform: uppercase;
}
.contacto legend { background: var(--chocolate); }
.persona-del {
  position: absolute; top: .55rem; right: .7rem;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--beige);
  background: var(--blanco); color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.persona-del:hover { color: var(--error); border-color: var(--error); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .75rem .9rem;
  font: 400 1rem/1.3 var(--f-sans); color: var(--texto);
  background: var(--blanco); border: 1px solid var(--beige-osc); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7A4A' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.4rem;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(107, 122, 74, .15); }
.field .err { display: block; min-height: 0; color: var(--error); font-size: .82rem; line-height: 1.3; margin-top: .3rem; }
.field.invalid input, .field.invalid select { border-color: var(--error); background: #FFF8F6; }

/* Selector segmentado (Sí / No, Adulto / Menor) */
.seg { display: flex; border: 1px solid var(--beige-osc); border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: .72rem .4rem;
  font-size: .92rem; color: var(--texto); transition: background .2s, color .2s;
}
.seg label + label span { border-left: 1px solid var(--beige-osc); }
.seg input:checked + span { background: var(--verde-seco); color: var(--blanco); font-weight: 400; }
.seg input[value="no"]:checked + span { background: var(--beige-osc); }
.seg input:focus-visible + span { outline: 2px solid var(--verde); outline-offset: -2px; }

.btn-add {
  width: 100%; background: transparent; color: var(--verde);
  border: 1.5px dashed var(--verde-seco); border-radius: var(--radius); padding: 1.05rem;
}
.btn-add:hover { background: var(--blanco); color: var(--verde-osc); border-color: var(--verde); box-shadow: none; }
.hint { text-align: center; font-size: .82rem; color: var(--muted); margin: .5rem 0 1.6rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { text-align: center; min-height: 1.4rem; margin: .4rem 0 1rem; font-size: .95rem; }
.form-status.error { color: var(--error); }
.btn-submit { display: flex; width: 100%; padding: 1.15rem; font-size: .9rem; }

.rsvp-ok {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--blanco); border: 1px solid var(--beige); border-radius: var(--radius);
  padding: 2.4rem 1.6rem; box-shadow: var(--shadow); animation: pop .4s ease;
}
.rsvp-ok h3 { font: 400 3.2rem/1 var(--f-script); }
.ok-list { list-style: none; padding: 0; margin: 1.2rem 0 1.8rem; }
.ok-list li { padding: .5rem 0; border-bottom: 1px solid var(--crema); font-family: var(--f-serif); font-size: 1.2rem; }
.ok-list li span { font: 400 .7rem/1 var(--f-sans); letter-spacing: .14em; text-transform: uppercase; padding: .3rem .6rem; border-radius: 999px; margin-left: .4rem; vertical-align: middle; }
.ok-list .si span { background: var(--verde-seco); color: var(--blanco); }
.ok-list .no span { background: var(--beige); color: var(--chocolate); }
.notice { max-width: 560px; margin: 0 auto; text-align: center; padding: 1.4rem; background: var(--blanco); border: 1px solid var(--beige); border-radius: var(--radius); }

/* ---------- Regalo ---------- */
.gift { max-width: 600px; margin: 0 auto; text-align: center; }
.gift-quote { font: italic 400 1.5rem/1.5 var(--f-serif); color: var(--chocolate); margin: 0 0 2.2rem; }
.bank {
  margin: 0; text-align: left;
  background: var(--crema); border: 1px solid var(--beige); border-radius: var(--radius); padding: .6rem 1.4rem;
}
.bank > div { display: grid; grid-template-columns: 90px 1fr; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--beige); }
.bank > div:last-child { border-bottom: 0; }
.bank dt { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bank dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-family: var(--f-serif); font-size: 1.3rem; color: var(--chocolate); font-weight: 500; word-break: break-word; }
.copy {
  flex-shrink: 0; padding: .4rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--verde); background: var(--blanco); color: var(--verde);
  font: 400 .7rem/1 var(--f-sans); letter-spacing: .14em; text-transform: uppercase;
}
.copy:hover { background: var(--verde); color: var(--blanco); }

/* ---------- Footer y toast ---------- */
.footer { text-align: center; padding: 4rem 1.5rem 5rem; background: var(--crema); border-top: 1px solid var(--beige); }
.footer-names { font: 400 2.8rem/1 var(--f-script); color: var(--chocolate); margin: .4rem 0; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--chocolate); color: var(--blanco); padding: .75rem 1.3rem; border-radius: 999px;
  font-size: .9rem; transition: .3s; pointer-events: none; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animaciones ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2.2rem; padding-top: 5.5rem; min-height: auto; }
  .hero-photo { order: -1; max-width: 300px; }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 260px 200px; grid-template-areas: "a a" "b c" "d d"; }
  .section { padding: 4.5rem 1.25rem; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero::before { inset: 6px; }
  .topnav { top: 10px; max-width: calc(100% - 24px); }
  .topnav a { padding: .45rem .6rem; font-size: .64rem; letter-spacing: .08em; }
  .cards, .grid-2 { grid-template-columns: 1fr; }
  .countdown { gap: .4rem; }
  .countdown div { min-width: 0; flex: 1; max-width: 72px; }
  .persona, .contacto { padding: 1.4rem 1rem .4rem; }
  .bank { padding: .4rem 1rem; }
  .bank > div { grid-template-columns: 1fr; gap: .2rem; }
  .bank dd { font-size: 1.15rem; }
  .map { height: 240px; }
}

/* ---------- Panel admin (?admin) ---------- */
body.admin { background: var(--crema); }
.admin-login { max-width: 360px; margin: 12vh auto; padding: 2.2rem; background: var(--blanco); border: 1px solid var(--beige); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-login h1 { font-size: 2rem; margin-bottom: 1.2rem; text-align: center; }
.admin-login .btn { width: 100%; }
.err-msg { color: var(--error); margin: 0 0 1rem; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-head h1 { font-size: 2.4rem; }
.admin-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
.admin-stats { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.5rem; }
.admin-stats div { background: var(--blanco); border: 1px solid var(--beige); border-radius: 12px; padding: .9rem 1.2rem; min-width: 120px; }
.admin-stats .restr { background: var(--beige); }
.admin-stats b { display: block; font: 600 1.8rem/1 var(--f-serif); color: var(--chocolate); }
.admin-stats span { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table-scroll { overflow-x: auto; background: var(--blanco); border: 1px solid var(--beige); border-radius: var(--radius); }
.admin table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin th { text-align: left; font-weight: 500; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .9rem .8rem; border-bottom: 1px solid var(--beige); white-space: nowrap; }
.admin td { padding: .7rem .8rem; border-bottom: 1px solid var(--crema); vertical-align: top; }
.admin tr.no-asiste td { color: var(--muted); background: #FBF9F5; }
.admin td form { margin: 0; }
.admin .empty { text-align: center; padding: 2.5rem; color: var(--muted); }
.btn-del { border: 1px solid var(--beige-osc); background: none; color: var(--error); border-radius: 999px; padding: .3rem .7rem; font-size: .75rem; cursor: pointer; }
.btn-del:hover { background: var(--error); color: var(--blanco); border-color: var(--error); }
