/* demokratian — ESPACIO · Forms & Page layout
   Page header, form card, sidebar, page body */

/* ═══════════════════════════════════════════════════════════════════
   PAGE HEADER (hero oscuro con imagen de fondo)
   ═══════════════════════════════════════════════════════════════════ */
.page-header {
  position: relative;
  padding: clamp(80px, 11vw, 140px) 0 clamp(64px, 9vw, 110px);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--header-image);
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  filter: saturate(.75);
  z-index: 0;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(80,119,0,.38) 0%, rgba(26,29,26,.78) 100%);
  z-index: 1;
}
.page-header > .esp-wrap { position: relative; z-index: 2; }

.page-header .crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header .crumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.page-header .crumbs a:hover { color: var(--green); border-bottom-color: var(--green); }
.page-header .crumbs .sep { opacity: 0.8; /* 0.4 daba 2,5:1 */ }
.page-header .crumbs .current { color: var(--paper); font-weight: 500; }

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 6.5vw, 80px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
  max-width: 22ch;
  color: var(--paper);
}

.page-header .page-eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.page-header .page-eyebrow::before {
  content: "";
  width: 24px;
  height: 1.5px;
  background: currentColor;
}

.page-header .page-deck {
  margin-top: 22px;
  font-size: 19px;
  color: rgba(255,255,255,0.82);
  max-width: 60ch;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════════
   PAGE BODY
   ═══════════════════════════════════════════════════════════════════ */
.page-body {
  padding: clamp(64px, 8vw, 96px) 0;
  background: var(--paper);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
}
.page-layout.with-sidebar {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM CARD
   ═══════════════════════════════════════════════════════════════════ */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
}

.form-intro {
  font-size: 14px;
  color: var(--slate);
  margin-bottom: 28px;
  line-height: 1.6;
}
.form-intro strong { color: var(--ink); font-weight: 600; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
}
.field label .req {
  color: var(--green-deep);
  font-size: 16px;
  line-height: 1;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="password"],
.field textarea,
.field select {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--white, #fff);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  box-sizing: border-box;
}

.field input[type="text"]::placeholder,
.field input[type="email"]::placeholder,
.field input[type="url"]::placeholder,
.field input[type="password"]::placeholder,
.field textarea::placeholder {
  color: var(--slate-soft, #aaa);
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="url"]:focus,
.field input[type="password"]:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-mist);
}

.field select {
  appearance: none;
  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' stroke='%236E6E6E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-body);
}

.help {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM CHECKBOXES
   ═══════════════════════════════════════════════════════════════════ */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.check-row input[type="checkbox"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  cursor: pointer;
}

.check-row .box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  /* var(--line) casi no se distinguía sobre fondos claros como
     .form-terms (--paper-warm): el checkbox se veía "invisible". */
  border: 1.5px solid var(--slate);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white, #fff);
  transition: all .2s;
  margin-top: 2px;
}
.check-row .box svg { opacity: 0; transition: opacity .15s; }

.check-row input[type="checkbox"]:checked + .box {
  background: var(--green-deep);
  border-color: var(--green-deep);
}
.check-row input[type="checkbox"]:checked + .box svg { opacity: 1; }

.check-row input[type="checkbox"]:focus + .box {
  box-shadow: 0 0 0 3px var(--green-mist);
}

.check-row a {
  color: var(--green-deep);
  border-bottom: 1px solid var(--green-soft, rgba(123,168,46,0.3));
  text-decoration: none;
  transition: border-color .2s;
}
.check-row a:hover {
  border-color: var(--green-deep);
}

.check-row.is-locked {
  cursor: not-allowed;
}
.check-row.is-locked .box {
  opacity: .55;
}
.check-row.is-locked span:last-child {
  color: var(--slate);
}

/* ═══════════════════════════════════════════════════════════════════
   TERMS BLOCK
   ═══════════════════════════════════════════════════════════════════ */
.form-terms {
  background: var(--paper-warm, #f8f7f4);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.form-terms-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.form-terms-body {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 16px;
}
.form-terms-body p {
  margin: 0 0 8px;
}
.form-terms-body p:last-child {
  margin-bottom: 0;
}
.form-terms-body a {
  color: var(--green-deep);
  border-bottom: 1px solid var(--green-soft, rgba(123,168,46,0.3));
  text-decoration: none;
  transition: border-color .2s;
}
.form-terms-body a:hover {
  border-color: var(--green-deep);
}
.form-terms .check-row {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM ACTIONS
   ═══════════════════════════════════════════════════════════════════ */
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.form-actions .submit {
  flex-shrink: 0;
}
.form-actions .note {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */
.page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.sidebar-card h2,
.sidebar-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--ink);
  font-family: var(--font-display);
}
.sidebar-card a {
  color: var(--green-deep);
  text-decoration: none;
  transition: color .2s;
}
.sidebar-card a:hover { color: var(--green-deep); }

.sidebar-contact-grid {
  display: grid;
  gap: 18px;
}
.sidebar-contact-grid .sc-label {
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 4px;
}
.sidebar-contact-grid .sc-email {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--green-deep);
}

.sidebar-card.highlight {
  background: var(--green-mist);
  border-color: var(--green-soft, rgba(123,168,46,0.3));
}
.sidebar-card.highlight h2,
.sidebar-card.highlight h4 {
  color: var(--green-deep);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .page-layout.with-sidebar {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .form-card {
    padding: 24px;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .submit {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SIGNUP HEADER — Hero compacto con gradiente doble (sin imagen)
   ═══════════════════════════════════════════════════════════════════ */
.signup-header {
  padding: clamp(48px, 7vw, 80px) 0 clamp(36px, 5vw, 56px);
  background:
    linear-gradient(180deg, rgba(20,30,18,0) 0%, rgba(20,30,18,.5) 100%),
    linear-gradient(90deg, rgba(20,30,18,.55) 0%, rgba(20,30,18,.15) 60%, transparent 100%),
    linear-gradient(135deg, #3a5518 0%, var(--ink) 75%);
  color: var(--paper);
}

.signup-header .crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.signup-header .crumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.signup-header .crumbs a:hover { color: var(--green); border-bottom-color: var(--green); }
.signup-header .crumbs .sep { opacity: .8; }
.signup-header .crumbs .current { color: var(--paper); font-weight: 500; }

.signup-header .page-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.signup-header .page-eyebrow::before {
  content: "";
  width: 24px;
  height: 1.5px;
  background: currentColor;
}
.signup-header h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: var(--paper);
  margin: 0 0 12px;
  max-width: 22ch;
}
.signup-header .signup-intro {
  font-size: 17px;
  color: rgba(255,255,255,.82);
  max-width: 60ch;
  line-height: 1.55;
  margin: 0;
}
@media (max-width: 600px) {
  .signup-header { padding: 28px 0 18px; }
}

/* ═══════════════════════════════════════════════════════════════════
   PHONE FIELD — Selector de país + número en línea
   Sin overflow:hidden para que el dropdown de Bootstrap no se corte
   ═══════════════════════════════════════════════════════════════════ */
.phone-field-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white, #fff);
}
.phone-field-group .country-select-wrap { flex: 0 0 auto; position: relative; }
/* Lista de paises del selector de prefijo (partial country_phone_list.php) */
.country-list { max-height: 200px; overflow-y: auto; }
/* Aviso de paises sin cobertura (EEUU/Canada): el desplegable es estrecho */
.country-list-nota {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.4;
  color: var(--slate);
  white-space: normal;
  max-width: 280px;
}
.phone-field-group .country-select .form-control {
  border: none !important;
  border-right: 1px solid var(--line) !important;
  border-radius: 9px 0 0 9px !important;
  background: #fff !important;
  font-size: 13px;
  padding: 10px 10px !important;
  height: 100%;
  box-shadow: none !important;
}
.phone-field-group input[type="tel"] {
  flex: 1;
  border: none !important;
  border-radius: 0 9px 9px 0 !important;
  padding: 12px 14px;
  font-size: 15px;
  background: transparent;
  min-width: 0;
}
.phone-field-group input[type="tel"]:focus { outline: none; }
.phone-field-group:focus-within {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

/* ═══════════════════════════════════════════════════════════════════
   CONFIRM PAGE — verificación SMS post-registro
   ═══════════════════════════════════════════════════════════════════ */
.esp-confirm-page {
  padding: clamp(32px, 4vw, 56px) 0 clamp(48px, 6vw, 80px);
}
.esp-confirm-page > .esp-wrap { width: 100%; }
