/* ============================================================
   form-interactive.css
   Styles for the fillable onboarding presentation system.
   Converts static visual elements into styled interactive inputs.
   ============================================================ */

/* CUSTOMER BANNER - Sticky top bar */
.form-banner {
  position: sticky;
  top: 0;
  z-index: 900;
  background: linear-gradient(135deg, #0d2d5e 0%, #1e40af 100%);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  flex-wrap: wrap;
}
.form-banner label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  white-space: nowrap;
}
.form-banner-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-banner input[type="text"],
.form-banner input[type="date"] {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  color: #fff;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-banner input[type="text"]:focus,
.form-banner input[type="date"]:focus {
  border-color: #5eead4;
  background: rgba(255,255,255,0.2);
}
.form-banner input::placeholder { color: rgba(255,255,255,0.5); }
.form-banner .banner-title {
  font-weight: 700;
  font-size: 14px;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-banner .banner-title svg { opacity: 0.7; }
.form-banner-nav {
  display: flex;
  gap: 6px;
}
.form-banner-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
  white-space: nowrap;
}
.form-banner-nav a:hover,
.form-banner-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.form-banner-nav a.active {
  background: #0d9488;
  border-color: #0d9488;
}

/* TEXT INPUTS - Replace .wl divs */
input.form-field,
textarea.form-field {
  width: 100%;
  border: none;
  border-bottom: 2px solid #94a3b8;
  background: transparent;
  padding: 4px 2px;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
  min-height: 24px;
  margin: 3px 0;
}
input.form-field:focus,
textarea.form-field:focus {
  border-bottom-color: #0d9488;
  background: rgba(13,148,136,0.04);
}
input.form-field::placeholder,
textarea.form-field::placeholder {
  color: #cbd5e1;
  font-style: italic;
}
textarea.form-field {
  resize: vertical;
  min-height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 8px;
}
textarea.form-field:focus {
  border-color: #0d9488;
}

/* CHECKBOXES - Replace .bx and .chk divs */
input.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #0d2d5e;
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  vertical-align: middle;
  margin-top: 1px;
}
input.form-checkbox:checked {
  background: #0d9488;
  border-color: #0d9488;
}
input.form-checkbox:checked::after {
  content: '\2713';
  color: #fff;
  position: absolute;
  top: -2px;
  left: 2px;
  font-size: 12px;
  font-weight: 700;
}
input.form-checkbox:hover {
  border-color: #0d9488;
}

/* Checklist-style checkboxes (.chk replacement) */
input.form-checkbox-chk {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  margin-top: 1px;
}
input.form-checkbox-chk:checked {
  background: #0d9488;
  border-color: #0d9488;
}
input.form-checkbox-chk:checked::after {
  content: '\2713';
  color: #fff;
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 13px;
  font-weight: 700;
}

/* STAT INPUTS - Replace ___ in stat cards */
input.form-stat {
  border: none;
  border-bottom: 2px dashed #cbd5e1;
  background: transparent;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #0d2d5e;
  width: 100%;
  padding: 2px 0;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
input.form-stat:focus {
  border-bottom-color: #0d9488;
  background: rgba(13,148,136,0.03);
}
input.form-stat::placeholder {
  color: #cbd5e1;
  font-weight: 400;
  font-size: 16px;
}
input.form-stat.small {
  font-size: 22px;
}

/* KPI trend inputs */
input.form-trend {
  border: none;
  border-bottom: 1px dashed #cbd5e1;
  background: transparent;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  width: 100%;
  padding: 2px 0;
  outline: none;
  font-family: inherit;
}
input.form-trend:focus {
  border-bottom-color: #0d9488;
}

/* INLINE INPUTS - For cover date/client and escalation contacts */
input.form-inline {
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  padding: 2px 4px;
  outline: none;
  min-width: 180px;
  transition: border-color 0.2s;
}
input.form-inline:focus {
  border-bottom-color: #5eead4;
}
input.form-inline::placeholder {
  opacity: 0.5;
}

/* Dark background inline inputs (for cover) */
.cover input.form-inline {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.4);
}
.cover input.form-inline:focus {
  border-bottom-color: #5eead4;
}
.cover input.form-inline::placeholder {
  color: rgba(255,255,255,0.4);
}

/* Inline inputs in normal background (escalation, worksheets) */
input.form-inline-dark {
  border: none;
  border-bottom: 1px dashed #94a3b8;
  background: transparent;
  color: #1e293b;
  font-size: 13px;
  font-family: inherit;
  padding: 2px 4px;
  outline: none;
  min-width: 160px;
  transition: border-color 0.2s;
}
input.form-inline-dark:focus {
  border-bottom-color: #0d9488;
  background: rgba(13,148,136,0.03);
}

/* SUBMIT BUTTON - Floating */
.form-submit-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.form-submit-btn {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(13,148,136,0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}
.form-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(13,148,136,0.45);
}
.form-submit-btn:active {
  transform: translateY(0);
}
.form-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.form-submit-btn svg {
  width: 18px;
  height: 18px;
}

.form-clear-btn {
  background: rgba(100,116,139,0.1);
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.form-clear-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* TOAST NOTIFICATIONS */
.form-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1100;
  background: #fff;
  border-radius: 10px;
  padding: 16px 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 380px;
}
.form-toast.show {
  transform: translateX(0);
}
.form-toast.success {
  border-left: 4px solid #059669;
  color: #059669;
}
.form-toast.error {
  border-left: 4px solid #dc2626;
  color: #dc2626;
}
.form-toast .toast-msg {
  color: #1e293b;
  font-weight: 500;
}

/* AUTO-SAVE INDICATOR */
.form-autosave {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 950;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.3s;
}
.form-autosave.saving {
  color: #0d9488;
}
.form-autosave .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.3s;
}
.form-autosave.saving .dot {
  background: #0d9488;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* PRINT STYLES */
@media print {
  .form-banner { display: none; }
  .form-submit-float { display: none; }
  .form-autosave { display: none; }
  .form-toast { display: none; }

  input.form-field,
  textarea.form-field {
    border: none;
    border-bottom: 1px solid #94a3b8;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  input.form-checkbox:checked,
  input.form-checkbox-chk:checked {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  input.form-stat {
    border: none;
  }
}

/* INDEX PAGE ENHANCEMENTS */
.customer-input-section {
  margin-top: 32px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.customer-input-row {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 6px 6px 6px 20px;
  gap: 12px;
  width: 100%;
  max-width: 520px;
}
.customer-input-row input[type="text"] {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  padding: 10px 4px;
  outline: none;
  flex: 1;
  min-width: 0;
}
.customer-input-row input::placeholder {
  color: rgba(255,255,255,0.45);
}
.customer-input-row .start-btn {
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}
.customer-input-row .start-btn:hover {
  background: #0f766e;
}
.facilitator-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}
.facilitator-row label {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.facilitator-row input[type="email"] {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-family: inherit;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.facilitator-row input[type="email"]::placeholder {
  color: rgba(255,255,255,0.35);
}
.facilitator-row input[type="email"]:focus {
  border-color: #5eead4;
}

/* Phase card status badge overrides for dynamic status */
.status-badge.submitted {
  background: #ecfdf5;
  color: #059669;
}
.status-badge.in-progress {
  background: #fffbeb;
  color: #d97706;
}

/* CAPTCHA MODAL */
.captcha-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.captcha-overlay.show { opacity: 1; }
.captcha-modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}
.captcha-header {
  font-size: 20px;
  font-weight: 700;
  color: #0d2d5e;
  margin-bottom: 6px;
}
.captcha-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}
.captcha-question {
  font-size: 32px;
  font-weight: 800;
  color: #1e40af;
  background: #eff6ff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  letter-spacing: 2px;
}
.captcha-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 20px;
  font-weight: 600;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.captcha-input:focus {
  border-color: #1e40af;
}
.captcha-error {
  color: #dc2626;
  font-size: 13px;
  min-height: 20px;
  margin-top: 6px;
}
.captcha-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.captcha-cancel, .captcha-confirm {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.captcha-cancel {
  background: #f1f5f9;
  color: #64748b;
}
.captcha-cancel:hover { background: #e2e8f0; }
.captcha-confirm {
  background: #0d9488;
  color: #fff;
}
.captcha-confirm:hover { background: #0f766e; }
