/* ============================================
   NAMOLI HEALTHCARE - CONTACT FORM PLUGIN
   ============================================ */

:root {
  --color-primary: #003B5D;
  --color-primary-hover: #002a42;
  --color-accent: #FF5E84;
  --color-accent-hover: #e04368;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-white: #FFFFFF;
  --color-bg-light: #f8fafc;
  --color-bg-warm: #EDF5FA;
  --color-border: #e2e8f0;
  --color-border-focus: #FF5E84;
  --color-error: #dc2626;
  --color-success: #16a34a;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.1);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* Reset */
.namoli-form-wrapper * { box-sizing: border-box; }
.namoli-form-wrapper {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
}

/* Form Container */
.form-main {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Form Card */
.form-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 28px 18px;
  background: var(--color-bg-warm);
  border-bottom: 1px solid var(--color-border);
  gap: 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.progress-step:not(:last-child)::after {
  content: "";
  width: 40px;
  height: 2px;
  background: var(--color-border);
  margin: 0 10px;
  transition: background-color var(--transition-base);
}

.progress-step:not(:last-child).completed::after {
  background: var(--color-accent);
}

.step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-muted);
  background: var(--color-white);
  transition: border-color var(--transition-base), background-color var(--transition-base), color var(--transition-base), transform var(--transition-fast);
  flex-shrink: 0;
}

.progress-step.active .step-circle {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
  transform: scale(1.08);
}

.progress-step.completed .step-circle {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: color var(--transition-base);
}

.progress-step.active .step-label {
  color: var(--color-text);
}

.progress-step.completed .step-label {
  color: var(--color-accent);
}

/* ============================================
   FORM STEPS
   ============================================ */
.form-body {
  padding: 28px 32px 32px;
}

.form-step {
  display: none;
  animation: fadeInUp 350ms ease forwards;
}

.form-step.active {
  display: block;
}

.form-step.success-state {
  display: none;
}

.form-step.success-state.active {
  display: block;
}

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

@media (prefers-reduced-motion: reduce) {
  .form-step {
    animation: none;
  }
}

.step-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.step-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* ============================================
   FORM FIELDS
   ============================================ */
.field-group {
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 5px;
}

.field-label .required {
  color: var(--color-accent);
  margin-left: 2px;
}

.field-label .optional {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 12px;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 94, 132, 0.1);
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: #94a3b8;
}

.field-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='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

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

.field-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.field-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}

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

.field-input.error,
.field-select.error {
  border-color: var(--color-error);
}

.field-input.valid,
.field-select.valid {
  border-color: var(--color-success);
}

/* ============================================
   SERVICE TYPE SELECTOR
   ============================================ */
.service-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.service-type-option {
  position: relative;
}

.service-type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.service-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  text-align: center;
  background: var(--color-white);
}

.service-type-card:hover {
  border-color: var(--color-accent);
  background: rgba(255, 94, 132, 0.02);
}

.service-type-option input[type="radio"]:checked + .service-type-card {
  border-color: var(--color-accent);
  background: rgba(255, 94, 132, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 94, 132, 0.12);
}

.service-type-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-type-icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  opacity: 0.7;
}

.service-type-option input[type="radio"]:checked + .service-type-card .service-type-icon svg {
  color: var(--color-accent);
  opacity: 1;
}

.service-type-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

/* ============================================
   RADIO PILLS
   ============================================ */
.radio-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.radio-pill {
  position: relative;
}

.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.radio-pill-label:hover {
  border-color: var(--color-accent);
}

.radio-pill input[type="radio"]:checked + .radio-pill-label {
  border-color: var(--color-accent);
  background: rgba(255, 94, 132, 0.06);
  color: var(--color-accent);
  font-weight: 600;
}

/* ============================================
   CHECKBOXES
   ============================================ */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 10px;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent);
}

.checkbox-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
}

.compliance-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* ============================================
   REVIEW SUMMARY
   ============================================ */
.review-summary {
  background: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 8px;
}

.review-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.review-value {
  font-weight: 700;
  color: var(--color-primary);
  text-align: right;
}

/* ============================================
   PRIVACY NOTE
   ============================================ */
.privacy-note {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding: 14px 16px;
  background: var(--color-bg-warm);
  border-radius: var(--radius-md);
}

.privacy-note a {
  color: var(--color-accent);
  text-decoration: underline;
}

.privacy-note a:hover {
  color: var(--color-accent-hover);
}

/* ============================================
   FORM NAVIGATION BUTTONS
   ============================================ */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-back:hover {
  color: var(--color-text);
  background: var(--color-bg-warm);
}

.btn-back:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-next,
.btn-submit,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-next,
.btn-submit,
.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-next:hover,
.btn-submit:hover,
.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-submit {
  font-size: 15px;
  padding: 14px 36px;
}

.btn-submit.loading {
  opacity: 0.7;
  pointer-events: none;
}

.btn-secondary {
  background: var(--color-bg-light);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-next svg,
.btn-back svg,
.btn-submit svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   SUCCESS STATE
   ============================================ */
.success-state {
  display: none;
  text-align: center;
  padding: 48px 28px;
}

.success-state.active {
  display: block;
  animation: fadeInUp 400ms ease forwards;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-success), #22c55e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.success-icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-white);
}

.success-state h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--color-primary);
}

.success-state p {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 380px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.success-message {
  margin-bottom: 24px;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.success-actions .btn-primary,
.success-actions .btn-secondary {
  padding: 12px 24px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .progress-bar {
    padding: 18px 14px 14px;
  }

  .step-label {
    display: none;
  }

  .progress-step:not(:last-child)::after {
    width: 28px;
  }

  .form-body {
    padding: 20px 18px 24px;
  }

  .service-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .form-nav {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .btn-next,
  .btn-submit {
    width: 100%;
    justify-content: center;
  }

  .btn-back {
    width: 100%;
    justify-content: center;
  }

  .review-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-value {
    text-align: left;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  .service-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  .step-title {
    font-size: 18px;
  }

  .form-body {
    padding: 16px 14px 20px;
  }

  .success-state {
    padding: 32px 16px;
  }

  .success-state h3 {
    font-size: 20px;
  }
}
