/* ============================================================
   CataZephyr — Availability Form   Mobile-first
   Namespace: .zf-*
   ============================================================ */

:root {
  --zf-navy:       #1a3a5c;
  --zf-blue:       #2563a8;
  --zf-teal:       #0d9488;
  --zf-white:      #ffffff;
  --zf-sand:       #f8f5f0;
  --zf-grey-50:    #fafafa;
  --zf-grey-100:   #f4f4f5;
  --zf-grey-300:   #d4d4d8;
  --zf-grey-500:   #71717a;
  --zf-grey-700:   #3f3f46;
  --zf-error:      #dc2626;
  --zf-success:    #16a34a;
  --zf-wa:         #25d366;
  --zf-radius:     8px;
  --zf-radius-lg:  14px;
  --zf-shadow:     0 4px 28px rgba(26, 58, 92, 0.11);
  --zf-ease:       0.25s ease;
  --zf-font:       system-ui, -apple-system, 'Segoe UI', Helvetica, sans-serif;
}

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

/* ── Demo page wrapper (strip when embedding in YOOtheme) ── */
.zf-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(155deg, #ddeeff 0%, #f0f9ff 60%, #e8f8f5 100%);
}

/* ── Form card ── */
.zf-form {
  background: var(--zf-white);
  border-radius: var(--zf-radius-lg);
  box-shadow: var(--zf-shadow);
  padding: 1.625rem 1.25rem 2rem;
  width: 100%;
  max-width: 548px;
  font-family: var(--zf-font);
  color: var(--zf-grey-700);
  position: relative;
  overflow: hidden;
}

/* ── Progress bar ── */
.zf-progress {
  margin-bottom: 1.75rem;
}

.zf-progress__bar {
  height: 4px;
  background: var(--zf-grey-100);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.zf-progress__bar::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--zf-blue), var(--zf-teal));
  border-radius: 2px;
  transition: width var(--zf-ease);
  width: 50%;
}

.zf-progress__bar[data-step="2"]::after { width: 100%; }

.zf-progress__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--zf-grey-500);
  line-height: 1;
}

/* ── Step fieldsets ── */
.zf-step {
  border: none;
  padding: 0;
  min-width: 0;
}

.zf-step[aria-hidden="true"] { display: none; }

.zf-step__title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--zf-navy);
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

/* ── Field layout ── */
.zf-field {
  margin-bottom: 1rem;
}

.zf-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* ── Labels ── */
.zf-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--zf-grey-700);
  margin-bottom: 0.375rem;
  line-height: 1.4;
}

.zf-optional {
  font-weight: 400;
  color: var(--zf-grey-500);
}

/* ── Inputs, selects, textarea ── */
.zf-input,
.zf-select,
.zf-textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--zf-grey-300);
  border-radius: var(--zf-radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--zf-grey-700);
  background: var(--zf-grey-50);
  line-height: 1.5;
  transition: border-color var(--zf-ease), box-shadow var(--zf-ease), background var(--zf-ease);
  -webkit-appearance: none;
  appearance: none;
}

.zf-input:focus,
.zf-select:focus,
.zf-textarea:focus {
  outline: none;
  border-color: var(--zf-blue);
  background: var(--zf-white);
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.13);
}

.zf-input.zf--invalid,
.zf-select.zf--invalid,
.zf-textarea.zf--invalid {
  border-color: var(--zf-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

/* Chevron for selects */
.zf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.375rem;
}

.zf-textarea {
  resize: vertical;
  min-height: 78px;
}

/* ── Hint + error text ── */
.zf-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--zf-grey-500);
  margin-top: 0.25rem;
}

.zf-error {
  display: block;
  font-size: 0.75rem;
  color: var(--zf-error);
  margin-top: 0.25rem;
  min-height: 1rem;
  line-height: 1.4;
}

/* ── Checkbox fields ── */
.zf-field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.zf-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  accent-color: var(--zf-blue);
  cursor: pointer;
  border-radius: 3px;
}

.zf-label--checkbox {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--zf-grey-700);
  margin: 0;
  cursor: pointer;
  line-height: 1.5;
}

.zf-label--checkbox a {
  color: var(--zf-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Honeypot (visually hidden, accessible) ── */
.zf-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Actions row ── */
.zf-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.375rem;
}

/* ── Buttons ── */
.zf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.375rem;
  border-radius: var(--zf-radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  line-height: 1;
  transition: opacity var(--zf-ease), transform 0.12s ease, background var(--zf-ease);
  white-space: nowrap;
}

.zf-btn:active { transform: scale(0.97); }

.zf-btn--full { width: 100%; display: flex; }

.zf-btn--primary {
  background: linear-gradient(135deg, var(--zf-navy) 0%, var(--zf-blue) 100%);
  color: var(--zf-white);
  flex: 1;
}

.zf-btn--primary:hover { opacity: 0.88; }

.zf-btn--ghost {
  background: transparent;
  color: var(--zf-grey-700);
  border: 1.5px solid var(--zf-grey-300);
}

.zf-btn--ghost:hover { background: var(--zf-grey-100); }

.zf-btn--wa {
  background: var(--zf-wa);
  color: var(--zf-white);
}

.zf-btn--wa:hover { opacity: 0.88; }

.zf-btn:disabled,
.zf-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Spinner inside submit button */
.zf-btn__spinner {
  display: none;
  width: 1.125em;
  height: 1.125em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: zf-spin 0.65s linear infinite;
  position: absolute;
}

.zf-btn--loading .zf-btn__label { visibility: hidden; }
.zf-btn--loading .zf-btn__spinner { display: block; }
.zf-btn--loading { position: relative; }

@keyframes zf-spin {
  to { transform: rotate(360deg); }
}

/* ── Success / Error states ── */
.zf-state {
  text-align: center;
  padding: 2.25rem 1rem 1.5rem;
}

.zf-state[hidden] { display: none; }

.zf-state__icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
}

.zf-state__title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.zf-state__body {
  color: var(--zf-grey-500);
  line-height: 1.65;
  margin-bottom: 1.375rem;
}

.zf-state--success .zf-state__title { color: var(--zf-success); }
.zf-state--error   .zf-state__title { color: var(--zf-error); }

.zf-state .zf-btn + .zf-btn { margin-top: 0.75rem; }

/* ── Responsive: tablet ── */
@media (min-width: 480px) {
  .zf-form {
    padding: 2.25rem 2.25rem 2.25rem;
  }
  .zf-step__title {
    font-size: 1.3125rem;
  }
}

/* ── Responsive: narrow phones ── */
@media (max-width: 359px) {
  .zf-field-row {
    grid-template-columns: 1fr;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
