/* =========================================================
   Encuentros Regionales de Familia — Estilos globales
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Typography ---- */
h1,h2,h3,h4,h5 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
}

/* ---- Eyebrow label ---- */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ac);
}

/* ---- CTA button (bordó fijo) ---- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  padding: 14px 30px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease);
  line-height: 1;
}
.btn-cta:hover { background: var(--color-primary-deep); }

/* ---- Secondary / outline button ---- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--r-input);
  border: 1px solid var(--rule-cool);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.btn-secondary:hover { border-color: var(--ac); background: var(--ac-soft); color: var(--ac-deep); }

/* ---- Danger button ---- */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #b91c1c;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--r-input);
  border: 1px solid #fca5a5;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease);
}
.btn-danger:hover { background: #fef2f2; }

/* ---- WhatsApp button ---- */
.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--whatsapp);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  padding: 13px 26px;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: background var(--dur-1) var(--ease);
}
.btn-wa:hover { background: var(--whatsapp-deep); }

/* ---- Form controls ---- */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule-input);
  border-radius: var(--r-input);
  padding: 10px 13px;
  outline: none;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--ac);
  box-shadow: var(--shadow-focus);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
}
.form-textarea { resize: vertical; }

/* ---- Radio / chip buttons ---- */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--rule-input);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-1) var(--ease);
  line-height: 1;
}
.chip-btn:hover { border-color: var(--ac); color: var(--ac-deep); background: var(--ac-soft); }
.chip-btn.selected {
  border-color: var(--ac);
  background: var(--ac-soft);
  color: var(--ac-deep);
  font-weight: 700;
}
.chip-btn .dot {
  width: 9px; height: 9px;
  border-radius: 999px;
  background: var(--rule-input);
  flex: none;
  transition: background var(--dur-1) var(--ease);
}
.chip-btn.selected .dot { background: var(--ac); }
.chip-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Stepper ---- */
.stepper-btn {
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--rule-input);
  background: #fff;
  color: var(--ac-deep);
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-1) var(--ease);
  line-height: 1;
  padding: 0;
  font-family: var(--font-body);
}
.stepper-btn:hover { border-color: var(--ac); background: var(--ac-soft); }

/* ---- Form section card ---- */
.form-section {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3.5vw, 34px);
}
.form-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--ac-soft);
  color: var(--ac-deep);
  font-family: var(--font-display);
  font-size: 17px;
  flex: none;
}

/* ---- Modal overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(48, 48, 48, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-box {
  background: #fff;
  border-radius: 24px;
  max-width: 460px;
  width: 100%;
  padding: 40px 34px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-modal);
}

/* ---- Toast / save banner ---- */
.save-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #E6F4EA;
  border: 1px solid #A8D5B5;
  border-radius: 10px;
  padding: 11px 16px;
  color: #1E6B42;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ---- Admin layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--panel-bg);
}

.admin-sidebar {
  width: 248px;
  flex: none;
  background: #fff;
  border-right: 1px solid #E7E1D8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
}
.admin-sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid #F0EBE2;
}
.admin-sidebar-logo {
  height: 46px;
  width: auto;
}
.admin-sidebar-tag {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
}
.admin-sidebar-nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all var(--dur-1) var(--ease);
}
.admin-nav-link:hover { background: #F5F0EA; color: var(--ink); }
.admin-nav-link.active {
  background: #FBE9EC;
  color: var(--color-primary);
  font-weight: 600;
}
.admin-sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid #F0EBE2;
  display: flex;
  align-items: center;
  gap: 11px;
}
.admin-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: clamp(20px, 3vw, 40px) clamp(20px, 3.5vw, 48px);
}
.admin-header {
  margin-bottom: 28px;
}
.admin-header-eyebrow {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9E8E7E;
  font-weight: 600;
}
.admin-header h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  color: var(--ink);
  margin-top: 6px;
}

/* ---- Stats grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border: 1px solid #E7E1D8;
  border-radius: 16px;
  padding: 22px 24px;
}
.stat-label {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1.1;
  margin-top: 6px;
}
.stat-sub {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ---- Admin table ---- */
.admin-table-wrap {
  background: #fff;
  border: 1px solid #E7E1D8;
  border-radius: 18px;
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  background: #FAF7F1;
  border-bottom: 1px solid #E7E1D8;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #9E8E7E;
  text-align: left;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F0EBE2;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }

/* ---- Card with top accent bar ---- */
.region-card {
  background: #fff;
  border: 1px solid #E7E1D8;
  border-radius: 18px;
  overflow: hidden;
}
.region-card-bar { height: 6px; }
.region-card-body { padding: 20px 22px; }

/* ---- Status pill ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
.status-pill.published { background: #E6F0EA; color: #467E5F; }
.status-pill.draft { background: #F0EBE2; color: #8A8A8A; }

/* ---- Search input ---- */
.search-wrap {
  position: relative;
  max-width: 340px;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
.search-wrap input {
  padding-left: 38px;
}

/* ---- Image upload area ---- */
.img-upload-wrap {
  border: 2px dashed var(--rule-input);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease);
}
.img-upload-wrap:hover { border-color: var(--ac); }
.img-preview {
  max-height: 140px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 10px;
}

/* ---- Region color dot ---- */
.region-dot {
  width: 12px; height: 12px;
  border-radius: 999px;
  flex: none;
}

/* ---- Placeholder image ---- */
.img-placeholder {
  width: 100%;
  background: var(--ac-soft);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ac);
  font-size: 13px;
  font-weight: 600;
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .admin-sidebar {
    display: none;
  }
  .admin-main {
    padding: 20px 16px;
  }
}
