/* ==========================================================================
   CERCANÍAS 1 — Application Form Styles
   apply.css — loaded only on apply.html
   ========================================================================== */

/* --------------------------------------------------------------------------
   APPLY PAGE LAYOUT
   -------------------------------------------------------------------------- */
.apply-page {
  min-height: 100vh;
  background: var(--bg);
}

/* Hero band at top of apply page */
.apply-hero {
  position: relative;
  height: 42vh;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-lg);
  overflow: hidden;
}
.apply-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 40%;
}
.apply-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6,8,14,0.4) 0%,
    rgba(6,8,14,0.85) 100%
  );
  z-index: 1;
}
.apply-hero__content {
  position: relative;
  z-index: 2;
  padding-inline: var(--px);
  max-width: var(--max-w);
  margin-inline: auto;
  width: 100%;
}
.apply-hero__eyebrow {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.apply-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 300;
  color: var(--ivory);
  line-height: 1;
}
.apply-hero__sub {
  font-size: var(--fs-sm);
  color: var(--ivory-muted);
  margin-top: 0.8rem;
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   FORM WRAPPER
   -------------------------------------------------------------------------- */
.apply-main {
  padding: var(--sp-xl) var(--px);
  max-width: 860px;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   PROGRESS INDICATOR
   -------------------------------------------------------------------------- */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-lg);
  gap: 0;
}
.progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  position: relative;
}
.progress__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 1px;
  background: var(--gold-border);
  z-index: 0;
}
.progress__step.is-done::after  { background: var(--gold-dk); }
.progress__step.is-active::after { background: var(--gold-border); }

.progress__bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all 0.4s ease;
}
.progress__step.is-done  .progress__bubble { background: var(--gold-dk); border-color: var(--gold-dk); color: var(--ivory); }
.progress__step.is-active .progress__bubble { background: var(--gold); border-color: var(--gold); color: var(--bg); }

.progress__label {
  font-size: 0.56rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.4s ease;
}
.progress__step.is-active .progress__label { color: var(--gold); }
.progress__step.is-done   .progress__label { color: var(--ivory-muted); }

/* --------------------------------------------------------------------------
   FORM STEPS
   -------------------------------------------------------------------------- */
.form-step {
  display: none;
  animation: stepIn 0.5s var(--ease) both;
}
.form-step.is-active { display: block; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-heading {
  margin-bottom: var(--sp-lg);
}
.step-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 300;
  color: var(--ivory);
  margin-bottom: 0.6rem;
}
.step-heading p {
  color: var(--ivory-muted);
  font-size: var(--fs-sm);
  line-height: 1.8;
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   FORM FIELDS
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md) var(--sp-md);
  margin-bottom: var(--sp-md);
}
.form-grid--full { grid-template-columns: 1fr; }
.form-grid--3    { grid-template-columns: 1fr 1fr 1fr; }

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

label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-muted);
}
label .req {
  color: var(--gold);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 300;
  padding: 0.85rem 1.1rem;
  outline: none;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  background: var(--bg-med);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.7;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23C9A96E'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
select option { background: var(--bg-card); color: var(--ivory); }

/* Input with prefix icon (e.g. @, +) */
.field__prefix-wrap {
  display: flex;
  border: 1px solid var(--gold-border);
  background: var(--bg-card);
  transition: border-color 0.3s ease;
}
.field__prefix-wrap:focus-within { border-color: var(--gold); }
.field__prefix {
  padding: 0.85rem 0.9rem;
  color: var(--gold);
  font-size: 0.85rem;
  user-select: none;
  border-right: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
}
.field__prefix-wrap input {
  border: none;
  flex: 1;
  background: transparent;
}
.field__prefix-wrap input:focus { background: transparent; }

/* Field hint text */
.field__hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-style: italic;
  margin-top: 2px;
}

/* Validation states */
.field.has-error label { color: #e06060; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #e06060; }
.field__error {
  font-size: 0.6rem;
  color: #e06060;
  display: none;
  margin-top: 2px;
}
.field.has-error .field__error { display: block; }

/* --------------------------------------------------------------------------
   SECTION SEPARATOR
   -------------------------------------------------------------------------- */
.form-section {
  margin-bottom: var(--sp-lg);
}
.form-section__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ivory);
  margin-bottom: var(--sp-md);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.form-section__num {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-family: var(--font-ui);
  font-weight: 500;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   FILE UPLOAD — Photo area
   -------------------------------------------------------------------------- */
.upload-zone {
  border: 1px dashed var(--gold-border);
  background: var(--bg-card);
  padding: var(--sp-lg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--bg-med);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}
.upload-zone__icon {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
  line-height: 1;
}
.upload-zone__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ivory);
  margin-bottom: 0.5rem;
}
.upload-zone__sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.upload-zone__hint {
  font-size: 0.65rem;
  color: var(--gold);
  margin-top: 0.75rem;
  opacity: 0.8;
  font-style: italic;
}

.upload-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: var(--sp-sm);
}
.upload-preview {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--gold-border);
}
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(6,8,14,0.85);
  border: 1px solid var(--gold-border);
  color: var(--ivory);
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.upload-preview__remove:hover { background: var(--gold); color: var(--bg); }

/* --------------------------------------------------------------------------
   CHECKBOX / RADIO
   -------------------------------------------------------------------------- */
.field--check {
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
}
.field--check input[type="checkbox"],
.field--check input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  margin-top: 2px;
  transition: all 0.3s ease;
  padding: 0;
}
.field--check input[type="checkbox"]:checked,
.field--check input[type="radio"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}
.field--check input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
}
.field--check label {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: none;
  font-weight: 300;
  color: var(--ivory-muted);
  line-height: 1.6;
  cursor: pointer;
}
.field--check label a { color: var(--gold); text-decoration: underline; }

/* --------------------------------------------------------------------------
   PARTNER TOGGLE
   -------------------------------------------------------------------------- */
.partner-toggle {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.partner-toggle__btn {
  flex: 1;
  padding: 0.85rem 1rem;
  text-align: center;
  border: 1px solid var(--gold-border);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-muted);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s ease;
}
.partner-toggle__btn.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}
.partner-toggle__btn:hover:not(.is-active) {
  border-color: var(--gold);
  color: var(--ivory);
}

/* --------------------------------------------------------------------------
   PAYMENT ACKNOWLEDGMENT BOX
   -------------------------------------------------------------------------- */
.payment-box {
  border: 1px solid var(--gold-border);
  background: var(--bg-card);
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
}
.payment-box__head {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ivory);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gold-border);
}
.payment-box__items {
  display: flex;
  gap: var(--sp-lg);
  margin-bottom: 1.5rem;
}
.payment-box__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.payment-box__item-label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.payment-box__item-val {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 300;
  color: var(--ivory);
  line-height: 1;
}
.payment-box__item-sub {
  font-size: 0.65rem;
  color: var(--ivory-muted);
}
.payment-box__note {
  font-size: var(--fs-sm);
  color: var(--ivory-muted);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   REVIEW SUMMARY
   -------------------------------------------------------------------------- */
.review-section {
  margin-bottom: var(--sp-md);
  border: 1px solid var(--gold-border);
  background: var(--bg-card);
}
.review-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gold-border);
}
.review-section__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ivory);
  font-weight: 400;
}
.review-section__edit {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  transition: opacity 0.2s ease;
  background: none;
  border: none;
  font-family: var(--font-ui);
}
.review-section__edit:hover { opacity: 0.7; }
.review-section__body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm) var(--sp-md);
}
.review-field { }
.review-field__label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.review-field__val {
  font-size: 0.85rem;
  color: var(--ivory);
  font-weight: 300;
}
.review-field--full { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   FORM NAVIGATION (prev / next / submit)
   -------------------------------------------------------------------------- */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--gold-border);
}
.form-nav__back {
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-muted);
  border: 1px solid transparent;
  padding: 0.65rem 1.5rem;
  background: none;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all var(--fast);
}
.form-nav__back:hover { color: var(--ivory); border-color: var(--gold-border); }
.form-nav__step-info {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   SUCCESS SCREEN
   -------------------------------------------------------------------------- */
.success-screen {
  display: none;
  text-align: center;
  padding: var(--sp-xl) var(--px);
  animation: stepIn 0.6s var(--ease) both;
}
.success-screen.is-visible { display: block; }
.success-screen__icon {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: var(--sp-md);
  display: block;
}
.success-screen__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  color: var(--ivory);
  margin-bottom: 1.2rem;
}
.success-screen__body {
  color: var(--ivory-muted);
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  max-width: 52ch;
  margin-inline: auto;
  line-height: 1.9;
  margin-bottom: var(--sp-lg);
}
.success-screen__rule {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: var(--sp-md) auto;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .form-grid,
  .form-grid--3  { grid-template-columns: 1fr; }
  .payment-box__items { flex-direction: column; gap: var(--sp-md); }
  .review-section__body { grid-template-columns: 1fr; }
  .progress__label { display: none; }
}
