:root{
  --max: 980px;
  --bg: #fbfaf7;
  --card: #ffffff;
  --text: #121212;
  --muted: rgba(18,18,18,.70);
  --line: rgba(18,18,18,.14);
  --soft: rgba(18,18,18,.08);
  --radius: 14px;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height:1.45;
  padding-bottom: 110px;
}

html {
  scroll-behavior: smooth;
}

main{
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 40px;
}

h1{
  font-family: var(--serif);
  font-size: 34px;
  margin: 0 0 18px;
}

h2{
  font-family: var(--serif);
  font-size: 18px;
  margin: 22px 0 10px;
  color: var(--text);
}

form{
  background: var(--card);
  border: 1px solid rgba(18,18,18,.06);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.03);
}

label{
  display:block;
  margin: 8px 0;
  font-size: 13px;
  font-weight: 400;
  color: rgba(18,18,18,.65);
}

input, select, textarea{
  width: 100%;
  margin-top: 6px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid rgba(18,18,18,.12);
  background: #fff;
  color: rgba(18,18,18,.88);
  font: inherit;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input,
select{
  min-height: 44px;
}

textarea{
  resize: vertical;
  min-height: 92px;
}

input:focus,
select:focus,
textarea:focus{
  outline: none;
  border-color: rgba(18,18,18,.28);
  box-shadow: 0 0 0 3px rgba(18,18,18,.06);
  background: #fffdfa;
}

input::placeholder,
textarea::placeholder{
  color: rgba(18,18,18,.45);
}

.actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  grid-column: span 2;
}

button{
  appearance:none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 600;
}

button:hover{background: rgba(18,18,18,.04);}

hr{
  border:0;
  border-top:1px solid var(--soft);
  margin: 22px 0;
}

#rsvp-settings{
  scroll-margin-top: 90px;
}

.highlight-target{
  animation: highlightFade 4.5s ease;
}

@keyframes highlightFade{
  0%{
    background: rgba(0,0,0,0.08);
  }
  100%{
    background: transparent;
  }
}

iframe{
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: #fff;
}

/* Checkbox line (RSVP) */
.checkline{
  margin-top: 10px;
}

label.check{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--muted);
}

label.check input[type="checkbox"]{
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #111;
}

/* Center preview iframe inside its column */
#previewFrame{
  display:block;
  margin: 0 auto;
  width: 100%;
  height: 600px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  background: #fff;
}

/* Solo aspecto móvil en pantallas pequeñas */
@media (max-width: 860px){
  #previewFrame{
    max-width: 420px;
    margin: 0 auto;
  }
}

/* Default: 1 column */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px 16px;
}

@media(min-width: 1024px){
  .grid{grid-template-columns: 1fr 1fr;}
  .span-2{grid-column: span 2;}
}

/* Force 1 column on phones / small screens */
@media (max-width: 1023px){
  .grid{
    grid-template-columns: 1fr !important;
  }
  .span-2{
    grid-column: auto !important;
  }
}

/* ===== Floating action bar ===== */

.floating-actions{
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  z-index: 9999;
  display:none;
}

.floating-actions button{
  border: 1px solid rgba(0,0,0,0.08);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  background: white;
  transition: all 0.2s ease;
}

.floating-actions button:hover{
  transform: translateY(-1px);
}

.floating-actions .primary{
  background: black;
  color: white;
  border: none;
}

/* En móvil que ocupe ancho completo */
@media (max-width: 768px){
  .floating-actions{
    width: calc(100% - 32px);
    left: 16px;
    transform: none;
    justify-content: space-between;
  }
}

/* ===== Top bar aligned to centered content ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background: rgba(251,250,247,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--soft);
}

.topbar-inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-brand{
  margin-right: auto;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand img{
  width: 22px;
  height: 22px;
  display: block;
}

@media (max-width: 560px){
  .topbar-brand{
    width: 100%;
    margin-right: 0;
    margin-bottom: 2px;
    font-size: 16px;
  }

  .topbar-brand img{
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
}

/* Grupo de acciones a la derecha */
.topbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-left:auto;
  flex-wrap:wrap;
}

.topbar-inner a:not(.topbar-brand),
.topbar-inner button:not(.icon-btn){
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font: inherit;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-inner a:not(.topbar-brand):hover,
.topbar-inner button:not(.icon-btn):hover{
  background: rgba(18,18,18,.04);
}

.topbar-inner .primary{
  background: #121212;
  color: #fff;
  border-color: #121212;
}

.topbar-inner .primary:hover{
  background: #121212;
  opacity: .92;
}

/* Edit page topbar alignment */
.topbar-inner-edit{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
}

/* Para que el scroll al preview no quede pegado arriba */
#previewSection{
  scroll-margin-top: 90px;
}

/* ===== Subtle back to top arrow ===== */
.icon-btn{
  appearance: none;
  background: rgba(0,0,0,0.04); 
  border: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  opacity: 0.85; 
  cursor: pointer;

  border-radius: 10px;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.icon-btn:hover{
  background: rgba(0,0,0,0.08);
  opacity: 1;
}

.icon-btn:active{
  transform: scale(0.96);
}

.upload-field{
  display:block;
  width:100%;
}

.upload-dropzone{
  display:block;
  width:100%;
  margin-top:8px;
  border:1px solid #d9d4cd;
  border-radius:14px;
  background:#fbfaf8;
  padding:18px 20px;
  cursor:pointer;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

.upload-dropzone:hover{
  background:#fffdf9;
  border-color:#c9c1b7;
  transform: translateY(-1px);
}

.upload-dropzone:focus-within{
  border-color:#111;
  box-shadow:0 0 0 3px rgba(17,17,17,.08);
  background:#fff;
}

.upload-dropzone-inner{
  display:flex;
  align-items:center;
  gap:14px;
}

.upload-icon{
  width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid #d9d4cd;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  line-height:1;
  color:#111;
  background:#fff;
  flex:0 0 42px;
}

.upload-texts{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.upload-texts strong{
  font-size:15px;
  font-weight:600;
  color:#111;
}

.upload-texts span{
  font-size:13px;
  color:#6f6a63;
}

.upload-file-name{
  margin-top:10px;
  font-size:14px;
  display:flex;
  align-items:center;
  gap:8px;
  color:#666;
}

.upload-status{
  color:#2ecc71;
  font-weight:600;
  font-size:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  visibility:hidden;
}

.upload-file-name.has-file .upload-status{
  visibility:visible;
}

.upload-file-name.has-file{
  color:#111;
  font-weight:500;
}

.upload-field small{
  display:block;
  margin-top:8px;
  color:#7a746d;
  font-size:13px;
  line-height:1.45;
}

.builder-flow{
  font-size:14px;
  color:#6f6a63;
  margin:28px 0 12px;
}

.builder-flow strong{
  color:#111;
  font-weight:600;
}

.website-link{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  margin-bottom:20px;
}

.website-url{
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  text-decoration:none;
}

.helper{
  display:block;
  margin-top:2px;
  font-size:12.5px;
  line-height:1.45;
  color: rgba(18,18,18,.55);
}

.copy-btn{
  padding:6px 10px;
  font-size:13px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  cursor:pointer;
}

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

.extra-blocks-panel{
  margin: 14px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.35);
}

.extra-blocks-panel summary{
  cursor: pointer;
  font-weight: 600;
  margin: 0;
}

.extra-blocks-panel[open] summary{
  margin-bottom: 10px;
}

.extra-blocks-panel .helper{
  display: block;
  margin-bottom: 12px;
}

/* ===== Top bar responsive ===== */
@media (max-width: 768px){
  .topbar-inner{
    min-height: auto;
    padding: 10px 18px;
    gap: 10px;
  }

  .topbar-brand{
    font-size: 16px;
  }

  .topbar-actions{
    gap: 8px;
  }

  .topbar-inner a:not(.topbar-brand),
  .topbar-inner button:not(.icon-btn){
    padding: 9px 12px;
  }
}

@media (max-width: 560px){
  .topbar-inner{
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar-brand{
    flex: 1 1 100%;
  }

  .topbar-actions{
    width: 100%;
    justify-content: flex-end;
  }
}

.gallery-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.gallery-count{
  font-size:13px;
  color:#666;
}

.gallery-upgrade{
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: #f7f4ee;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.gallery-upgrade p{
  margin: 0 0 6px;
  line-height: 1.45;
}

.gallery-upgrade p:first-child{
  font-weight: 600;
}

.gallery-upgrade p:last-of-type{
  margin-bottom: 12px;
  color: rgba(0,0,0,.72);
}

.gallery-upgrade-btn{
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  background: #121212;
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
  white-space: nowrap;
}

.gallery-upgrade-btn:hover{
  background: #1a1a1a;
  transform: translateY(-1px);
}

.gallery-upgrade-btn:active{
  transform: translateY(0);
}

.gallery-count.is-full {
  color: #121212;
  font-weight: 600;
}

#galleryFiles.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Ajuste específico para el campo fecha en móvil */
@media (max-width: 768px){
  input[type="date"]{
    min-height: 44px;
    height: 44px;
    padding: 0 13px;
    font-size: 16px;
    line-height: 44px;
    -webkit-appearance: none;
    appearance: none;
  }
}

@media (max-width: 768px){
  input[type="date"]::-webkit-date-and-time-value{
    text-align: center;
  }
}

#galleryMsg{
  font-size:14px;
  font-weight:500;
  color:rgba(0,0,0,.6);
  margin-top:10px;
  letter-spacing:.2px;
  transition:opacity .25s ease;
}

/* estado "cargando" */
#galleryMsg.is-loading{
  color:rgba(0,0,0,.5);
}

/* animación sutil tipo iOS */
#galleryMsg.is-loading::after{
  content:'';
  display:inline-block;
  width:6px;
  height:6px;
  margin-left:8px;
  border-radius:50%;
  background:currentColor;
  opacity:.4;
  animation:uploadPulse 1.2s infinite ease-in-out;
}

@keyframes uploadPulse{
  0%,100%{opacity:.2; transform:scale(.9);}
  50%{opacity:.7; transform:scale(1);}
}

.rsvp-help-title{
  font-size: 12px;
  font-weight: 500;
  margin-top: 10px;
  margin-bottom: 4px;
  color: rgba(18,18,18,.7);
}

.rsvp-help{
  font-size: 13px;
  line-height: 1.5;
  color: rgba(18,18,18,.75);
  padding-left: 10px;
  border-left: 2px solid rgba(18,18,18,.15);
}

.panel-link{
  display: block;
  margin: 6px 0 14px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(18,18,18,.55);
  text-decoration: none;
}

.panel-link:hover{
  color: rgba(18,18,18,.85);
  text-decoration: underline;
}

#galleryManager{
  scroll-margin-top: 40px;
}

/* ===== Footer ===== */
.footer{
  padding: 26px 0 8px 0;
  border-top: 1px solid var(--soft);
  margin-top: 28px;
}

.footnote{
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  opacity: .65;
}

.footer-lang{
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 12px; /* antes 11px */
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .6; /* antes .5 */
  margin-top: 14px;
  margin-bottom: 10px;
}

.footer-lang a{
  text-decoration: none;
  color: inherit;
}

.footer-lang i{
  font-size: 11px;
  opacity: .7;
  margin-right: 4px;
  transform: translateY(-1px);
}

/* estilo de los puntos (span) */
.footer-lang span{
  opacity: .6;
}

/* hover */
.footer-lang a:hover{
  opacity: 1;
}

/* activo */
.footer-lang a.active{
  opacity: 1;
  font-weight: 500; 
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.footer-legal{
  margin-top:6px;
  font-size:9px;
  opacity:.45;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.footer-legal a{
  color:inherit;
  text-decoration:none;
}

.footer-legal a:hover{
  text-decoration:underline;
  opacity:.8;
}

.cookie-banner{
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.cookie-banner-text{
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: inherit;
}

.cookie-banner-text a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-actions button{
  appearance: none;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}

/* Accept (principal) */
.cookie-actions button[data-cookie-action="accept"]{
  background: #171717;
  color: #fff;
  border: 1px solid #171717;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.cookie-actions button[data-cookie-action="accept"]:hover{
  opacity: .92;
  transform: translateY(-1px);
}

/* Reject (secondary, limpio) */
.cookie-actions button[data-cookie-action="reject"]{
  background: transparent;
  border: 1px solid rgba(0,0,0,.12);
  color: inherit;
}

.cookie-actions button[data-cookie-action="reject"]:hover{
  background: rgba(0,0,0,.04);
}

/* Mobile */
@media (max-width: 640px){
  .cookie-banner{
    bottom: 56px;
    width: calc(100% - 20px);
    padding: 12px 14px;
    border-radius: 14px;
  }

  .cookie-banner-text{
    font-size: 12px;
  }

  .cookie-actions button{
    font-size: 12px;
    padding: 8px 11px;
  }
}