/* =============================================================================
   interview-form.css — AgreeTemplate V2.0 Phase C
   Multi-step structured interview form for lease agreement generation.
   Compatible with WordPress / Elementor page layouts.
   ============================================================================= */

/* ── Base Container ───────────────────────────────────────────────────────── */

.at-interview {
  max-width: 640px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  line-height: 1.5;
}

/* ── Edit Mode Banner ─────────────────────────────────────────────────────── */

.at-edit-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #1d4ed8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Step Indicator Bar ───────────────────────────────────────────────────── */

.at-steps-bar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 36px;
  padding: 0 8px;
}

.at-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
  min-width: 64px;
}

.at-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: #e2e8f0;
  color: #94a3b8;
  transition: all 0.3s ease;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.at-step-item.active .at-step-circle {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.at-step-item.completed .at-step-circle {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.at-step-label {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  text-align: center;
}

.at-step-item.active .at-step-label { color: #2563eb; font-weight: 600; }
.at-step-item.completed .at-step-label { color: #10b981; }

.at-step-connector {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 17px 6px 0;
  transition: background 0.3s ease;
}

.at-step-connector.completed { background: #10b981; }

/* ── Step Panels ──────────────────────────────────────────────────────────── */

.at-step-panel {
  display: none;
  animation: at-panel-in 0.25s ease;
}

.at-step-panel.active { display: block; }

@keyframes at-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.at-step-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
}

.at-step-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 28px;
}

/* ── Form Fields ──────────────────────────────────────────────────────────── */

.at-field { margin-bottom: 20px; }

.at-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.at-required { color: #ef4444; margin-left: 2px; }

.at-field input[type="text"],
.at-field input[type="email"],
.at-field input[type="number"],
.at-field input[type="date"],
.at-field select,
.at-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  background: #f9fafb;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.at-field input:focus,
.at-field select:focus,
.at-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.at-field input.at-input-error,
.at-field select.at-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.at-field textarea {
  resize: vertical;
  min-height: 80px;
}

.at-field-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.at-field-error.visible { display: block; }

.at-field-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Currency Input ───────────────────────────────────────────────────────── */

.at-currency-wrap { position: relative; }

.at-currency-wrap input { padding-left: 14px; }

/* ── Unit Suffix Input (e.g. "months") ───────────────────────────────────── */

.at-unit-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.at-unit-wrap input {
  width: 100%;
  padding: 10px 80px 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  background: #f9fafb;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.at-unit-wrap input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.at-unit-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

/* ── Radio & Checkbox Groups ──────────────────────────────────────────────── */

.at-radio-group, .at-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.at-radio-option, .at-checkbox-option { position: relative; }

.at-radio-option input,
.at-checkbox-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.at-radio-option label,
.at-checkbox-option label {
  display: inline-block;
  padding: 8px 20px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  background: #f9fafb;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
}

.at-radio-option label:hover,
.at-checkbox-option label:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.at-radio-option input:checked + label,
.at-checkbox-option input:checked + label {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.at-radio-option input:focus-visible + label,
.at-checkbox-option input:focus-visible + label {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ── Conditional Fields ───────────────────────────────────────────────────── */

.at-field.at-conditional {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
  pointer-events: none;
}

.at-field.at-conditional.visible {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 20px;
  pointer-events: auto;
}

/* ── Navigation Buttons ───────────────────────────────────────────────────── */

.at-interview-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.at-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  line-height: 1.3;
}

.at-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.at-btn-back {
  background: #f1f5f9;
  color: #475569;
}
.at-btn-back:hover { background: #e2e8f0; }

.at-btn-next {
  background: #2563eb;
  color: #fff;
  margin-left: auto;
}
.at-btn-next:hover { background: #1d4ed8; }

.at-btn-generate {
  background: #f59e0b;
  color: #ffffff;
  padding: 14px 32px;
  font-size: 16px;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.at-btn-generate:hover {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
}

/* ── Progress Overlay ─────────────────────────────────────────────────────── */

.at-interview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
}

.at-interview-overlay.visible { display: flex; }

.at-overlay-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  width: min(480px, 90vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.at-overlay-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 24px;
}

.at-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.at-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.at-overlay-percent {
  font-size: 32px;
  font-weight: 700;
  color: #2563eb;
}

.at-overlay-time {
  font-size: 14px;
  color: #64748b;
  margin-top: 8px;
}

.at-overlay-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 16px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  display: none;
}

/* ── Disclaimer ───────────────────────────────────────────────────────────── */

.at-interview-disclaimer {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin-top: 20px;
  line-height: 1.5;
}

/* ── Mobile Responsive ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .at-interview { padding: 0 4px; }
  .at-step-label { font-size: 10px; }
  .at-step-circle { width: 30px; height: 30px; font-size: 12px; }
  .at-step-connector { margin: 14px 4px 0; }
  .at-step-title { font-size: 18px; }
  .at-step-subtitle { font-size: 13px; margin-bottom: 20px; }
  .at-field input, .at-field select, .at-field textarea { font-size: 16px; }
  .at-btn { padding: 10px 20px; font-size: 14px; }
  .at-btn-generate { padding: 12px 24px; font-size: 15px; }
  .at-overlay-box { padding: 24px; }
  .at-overlay-title { font-size: 17px; }
  .at-overlay-percent { font-size: 26px; }
  .at-radio-option label, .at-checkbox-option label { padding: 8px 14px; font-size: 13px; }
}
