/* Nawal's Care — health form */

.nc-form {
  --nc-ink: #25221f;
  --nc-muted: #7a7168;
  --nc-accent: #8b6b52;
  --nc-line: #e4d9cc;
  --nc-cream: #fffdf9;
  --nc-wash: #f4eee6;
  width: min(780px, 100%);
  margin-inline: auto;
  padding: 1.35rem 1.1rem 3.5rem;
  color: var(--nc-ink);
}

.nc-form .top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.nc-form .back-link {
  color: var(--nc-accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nc-form .back-link:hover {
  color: var(--nc-ink);
}

.nc-form #draftStatus {
  font-size: 0.78rem;
  color: var(--nc-muted);
}

.nc-form .card {
  background: var(--nc-cream);
  border: 1px solid rgba(201, 184, 167, 0.55);
  border-radius: 1.35rem;
  box-shadow: 0 18px 42px rgba(37, 34, 31, 0.06);
  padding: 1.45rem 1.35rem 1.6rem;
  overflow: hidden;
}

@media (min-width: 640px) {
  .nc-form .card {
    padding: 1.85rem 1.9rem 2rem;
  }
}

.nc-form .form-header {
  margin-bottom: 0.15rem;
}

.nc-form .form-header h1 {
  margin: 0 0 0.4rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.25rem);
  letter-spacing: -0.02em;
  color: var(--nc-ink);
}

.nc-form .form-header p {
  margin: 0;
  color: var(--nc-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.nc-form .progress-wrap {
  margin: 1.4rem 0 0.4rem;
}

.nc-form .progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  color: var(--nc-muted);
  margin-bottom: 0.5rem;
}

.nc-form .progress-row strong {
  font-weight: 600;
  color: var(--nc-ink);
}

.nc-form .progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--nc-wash);
  overflow: hidden;
}

.nc-form .progress-fill {
  height: 100%;
  width: 14%;
  background: linear-gradient(90deg, #c9b8a7, var(--nc-accent));
  border-radius: inherit;
  transition: width 360ms ease;
}

.nc-form .step-viewport {
  position: relative;
  min-height: 280px;
  margin-top: 1.15rem;
}

.nc-form .step-panel {
  display: none;
  opacity: 0;
}

.nc-form .step-panel.active {
  display: block;
  animation: ncEnter 400ms ease both;
}

.nc-form .step-panel.leaving {
  display: block;
  animation: ncLeave 320ms ease both;
}

.nc-form .step-title {
  margin: 0 0 1rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--nc-ink);
}

.nc-form .grid {
  display: grid;
  gap: 0.9rem;
}

.nc-form .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nc-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.nc-form .field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #4a433c;
}

.nc-form .field input,
.nc-form .field select,
.nc-form .field textarea {
  width: 100%;
  border: 1px solid var(--nc-line);
  background: #fff;
  border-radius: 0.8rem;
  padding: 0.72rem 0.9rem;
  font-size: 0.95rem;
  color: var(--nc-ink);
  font-family: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.nc-form .field textarea {
  min-height: 96px;
  resize: vertical;
}

.nc-form .field input:focus,
.nc-form .field select:focus,
.nc-form .field textarea:focus {
  outline: none;
  border-color: var(--nc-accent);
  box-shadow: 0 0 0 3px rgba(139, 107, 82, 0.16);
}

.nc-form .radio-group,
.nc-form .checks {
  display: grid;
  gap: 0.6rem;
}

.nc-form .radio-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nc-form .radio-group label,
.nc-form .checks label {
  border: 1px solid var(--nc-line);
  background: #fff;
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
  color: #4a433c;
  cursor: pointer;
}

.nc-form .radio-group input,
.nc-form .checks input {
  margin-top: 0.15rem;
  accent-color: var(--nc-accent);
}

.nc-form .field input.error,
.nc-form .field select.error,
.nc-form .field textarea.error,
.nc-form .radio-group.shake,
.nc-form .checks label.error,
.nc-form canvas.error {
  border-color: rgba(170, 80, 70, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(170, 80, 70, 0.12) !important;
}

.nc-form .shake {
  animation: ncShake 340ms ease;
}

.nc-form .signature-tools {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.nc-form .chip {
  border: 1px solid var(--nc-line);
  background: var(--nc-wash);
  color: #4a433c;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
}

.nc-form .chip.active {
  background: #ebe2d6;
  border-color: #c9b8a7;
  color: var(--nc-ink);
}

.nc-form .signature-canvas-wrap {
  border: 1px dashed #c9b8a7;
  border-radius: 0.85rem;
  padding: 0.65rem;
  background: var(--nc-wash);
}

.nc-form #signatureCanvas {
  width: 100%;
  height: 140px;
  display: block;
  border-radius: 0.6rem;
  background: #fff;
  border: 1px solid var(--nc-line);
  touch-action: none;
}

.nc-form .hint {
  color: var(--nc-muted);
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.nc-form .actions {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
}

.nc-form .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.nc-form .btn.secondary {
  background: transparent;
  border: 1px solid var(--nc-ink);
  color: var(--nc-ink);
}

.nc-form .btn.secondary:hover {
  background: rgba(37, 34, 31, 0.06);
  color: var(--nc-ink);
}

.nc-form .btn.primary {
  background: var(--nc-ink);
  border: 1px solid var(--nc-ink);
  color: #fff;
}

.nc-form .btn.primary:hover {
  background: #3a342e;
  border-color: #3a342e;
  color: #fff;
}

.nc-form .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.nc-form .success-state {
  display: none;
  text-align: center;
  padding: 2.2rem 0.5rem 0.4rem;
}

.nc-form .success-state.visible {
  display: block;
  animation: ncFade 440ms ease both;
}

.nc-form .checkmark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 0.95rem;
  background: var(--nc-wash);
  border: 1px solid #c9b8a7;
  display: grid;
  place-items: center;
  color: var(--nc-accent);
  font-size: 1.7rem;
}

.nc-form .success-state h2 {
  margin: 0 0 0.4rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--nc-ink);
}

.nc-form .success-state p {
  margin: 0;
  color: var(--nc-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@keyframes ncEnter {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ncLeave {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(-12px);
  }
}

@keyframes ncShake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: none; }
}

@keyframes ncFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .nc-form .grid.two,
  .nc-form .radio-group {
    grid-template-columns: 1fr;
  }

  .nc-form .actions {
    flex-direction: column-reverse;
  }

  .nc-form .btn {
    width: 100%;
  }
}

[dir="rtl"] .nc-form .form-header h1,
[dir="rtl"] .nc-form .step-title,
[dir="rtl"] .nc-form .success-state h2 {
  font-family: Amiri, Georgia, serif;
}

[dir="rtl"] .nc-form .step-panel.active {
  animation-name: ncEnterRtl;
}

[dir="rtl"] .nc-form .step-panel.leaving {
  animation-name: ncLeaveRtl;
}

@keyframes ncEnterRtl {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ncLeaveRtl {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}
