/* Updated Root Variables to Match Website Theme */
:root {
  --clr-pink: #ec93b0;
  --clr-blue: #15215b;
  --clr-violet: #e5ddf3;
  --clr-text: #410b22;
  --fl-global-link-color: #15215b;
  --fl-global-link-hover-color: #ec93b0;
  --fl-global-button-color: #15215b;
  --fl-global-button-hover-color: #ec93b0;
  --fl-global-button-background: #ec93b0;
  --fl-global-button-hover-background: #15215b;
  --fl-global-button-font-weight: 500;
  --fl-global-button-font-size: 16px;
  --fl-global-button-line-height: 1.2;
  --fl-global-button-letter-spacing: -0.28px;
  --wp--preset--font-size--normal: 16px;
  --wp--preset--font-size--huge: 42px;
}

/* Patient Intake Form - Updated Styles */

/* Reset and Base Styles */
.patient-intake-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  line-height: 1.6;
  color: var(--clr-text);
  min-height: 100vh;
  padding: 20px 0;
}

.patient-intake-wrapper *,
.patient-intake-wrapper *::before,
.patient-intake-wrapper *::after {
  box-sizing: border-box;
}

/* Form Container */
.form-container {
  background: var(--clr-blue);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header */
.form-header {
  background: var(--clr-blue);
  color: white;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}

.form-header .logo {
  margin-bottom: 20px;
  text-align: center;
}

.form-header .logo svg {
  max-width: 226px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.form-header .logo img {
  max-height: 60px;
  width: auto;
  margin: 0 auto;
  display: block;
}

.form-header .logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.form-header .logo-subtitle {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
}

.form-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>')
    repeat;
  animation: float 20s linear infinite;
  z-index: 1;
}

@keyframes float {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.form-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 2;
}

.form-header .subtitle {
  opacity: 0.95;
  font-size: 1.1rem;
  margin: 6px;
  font-weight: 300;
  position: relative;
  z-index: 2;
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-pink) 0%, var(--clr-blue) 100%);
  width: 25%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 10px rgba(236, 147, 176, 0.3);
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: -15px;
  width: 15px;
  height: 100%;
  background: inherit;
  transform: skewX(-30deg);
}

/* Step Indicator */
.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0;
  margin: 0 32px;
  gap: 0;
}

.step {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f7fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #a0aec0;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid #e2e8f0;
  margin: 0 30px;
  z-index: 2;
}

.step.active {
  background: linear-gradient(135deg, var(--clr-pink) 0%, var(--clr-blue) 100%);
  color: white;
  transform: scale(1.15);
  border-color: var(--clr-pink);
  /* box-shadow: 0 8px 25px rgba(236, 147, 176, 0.4); */
}

.step.completed {
  background: #48bb78;
  color: white;
  border-color: #48bb78;
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.step.completed::before {
  content: "✓";
  font-size: 18px;
  font-weight: 900;
}

.step::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 15px);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e0 100%);
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 2px;
}

.step:last-child::after {
  display: none;
}

.step.completed::after {
  background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

/* Form Content */
.form-content {
  padding: 0 32px 32px;
  background: var(--clr-blue);
  color: white;
}

.form-step {
  display: none;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.step-content {
  max-width: 700px;
  margin: 0 auto;
}

.form-step h2 {
  color: white;
  font-size: 2rem;
  margin: 32px 0 16px 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step-description {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-bottom: 40px;
  font-weight: 400;
}

/* Form Sections */
.form-section {
  padding: 40px;
  border-radius: 20px;
  margin-bottom: 32px;
  border: 1px solid rgba(236, 147, 176, 0.2);
  transition: all 0.3s ease;
  color: var(--clr-blue);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* .form-section:hover {
  border-color: var(--clr-pink);
  box-shadow: 0 12px 40px rgba(236, 147, 176, 0.15);
  transform: translateY(-2px);
} */

.form-section h3 {
  color: #ffffff;
  font-size: 1.4rem;
  margin: 0 0 24px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Groups */
.form-group {
  margin-bottom: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 8px;
}

.section-label {
  display: block;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--clr-blue);
  font-size: 1.1rem;
}

.patient-intake-wrapper label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.required {
  color: #e53e3e;
  margin-left: 4px;
  font-weight: 700;
}

/* Form Inputs */
.patient-intake-wrapper input[type="text"],
.patient-intake-wrapper input[type="email"],
.patient-intake-wrapper input[type="date"],
.patient-intake-wrapper input[type="tel"],
.patient-intake-wrapper select,
.patient-intake-wrapper textarea {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  line-height: 1.5;
  color: var(--clr-text);
}

.patient-intake-wrapper input:focus,
.patient-intake-wrapper select:focus,
.patient-intake-wrapper textarea:focus {
  outline: none;
  border-color: var(--clr-pink);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(236, 147, 176, 0.1);
  transform: translateY(-2px);
}

.patient-intake-wrapper textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

/* Radio and Checkbox Groups */
.radio-group,
.checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  flex: 1;
  min-width: 160px;
}

/* .radio-item:hover,
.checkbox-item:hover {
  border-color: var(--clr-pink);
  background: rgba(236, 147, 176, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(236, 147, 176, 0.15);
} */

.radio-item input,
.checkbox-item input {
  margin: 0;
  width: 20px;
  height: 20px;
  accent-color: var(--clr-pink);
  cursor: pointer;
}

.radio-item label,
.checkbox-item label {
  margin: 0;
  cursor: pointer;
  color: #4a5568;
  font-weight: 500;
}

.radio-item input:checked + label,
.checkbox-item input:checked + label {
  color: var(--clr-pink);
  font-weight: 600;
}

.checkbox-item.important {
  border-color: var(--clr-pink);
  background: linear-gradient(
    135deg,
    rgba(236, 147, 176, 0.1) 0%,
    rgba(21, 33, 91, 0.05) 100%
  );
  position: relative;
  overflow: hidden;
}

.checkbox-item.important::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-pink) 0%, var(--clr-blue) 100%);
}

.checkbox-item.important:hover {
  border-color: var(--clr-blue);
  background: linear-gradient(
    135deg,
    rgba(236, 147, 176, 0.15) 0%,
    rgba(21, 33, 91, 0.1) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 147, 176, 0.2);
}

/* Appointment Lookup Step - Fixed Styling */
#appointment-lookup {
    color: #ffffff !important;
    text-align: center;
    padding: 0 15px;
    border-radius: 16px;
    margin: 0 0;
}

#appointment-lookup .step-content {
  background: transparent !important;
}

#appointment-lookup h2 {
  color: #ffffff !important;
  font-size: 1.75rem;
  margin-bottom: 16px;
  font-weight: 600;
}

#appointment-lookup p {
  color: #ffffff !important; !important;
  margin-bottom: 20px;
}

.step-description {
  color: rgba(255, 255, 255, 0.8) !important;
}

.lookup-section {
  margin-bottom: 40px;
  background: transparent !important;
}

.no-appointment-section {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--clr-blue) !important;
  border-radius: 16px;
  padding: 20px;
}

.no-appointment-section p {
  color: #718096 !important;
}

.divider {
  color: rgba(255, 255, 255, 0.6) !important;
  background: transparent !important;
}

.divider span {
  background: var(--clr-blue) !important;
}

/* Buttons */
.patient-intake-wrapper button {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-weight: var(--fl-global-button-font-weight);
  font-size: var(--fl-global-button-font-size);
  line-height: var(--fl-global-button-line-height);
  letter-spacing: var(--fl-global-button-letter-spacing);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.btn-primary {
  appearance: none;
  background-color: var(--fl-global-button-background) !important;
  border: 1px solid var(--fl-global-button-background) !important;
  color: var(--fl-global-button-color) !important;
  text-decoration: none !important;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--fl-global-button-hover-background) !important;
  color: var(--fl-global-button-hover-color) !important;
  box-shadow: 0 8px 25px rgba(21, 33, 91, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: #718096;
  color: white;
  box-shadow: 0 2px 10px rgba(113, 128, 150, 0.3);
}

.btn-secondary:hover {
  background: #4a5568;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(74, 85, 104, 0.4);
}

.btn-outline {
  background: #4a5568;
  color: white;
  border: 2px solid #e53e3e;
  box-shadow: none;
}

.btn-icon {
  font-size: 1.1rem;
}

.submit-btn {
  background: var(--clr-pink);
}

.button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}

/* Error States */
.error-message {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #e53e3e;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.error-message::before {
  content: "⚠";
  font-size: 1rem;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1) !important;
  background: #fef5f5 !important;
}

.radio-item.has-error,
.checkbox-item.has-error {
  border-color: #e53e3e !important;
  background: #fef5f5 !important;
}

/* Additional Styles */
.lookup-results {
  margin-top: 32px;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.lookup-results ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
}

.lookup-results li {
  background: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  color: var(--clr-blue);
}

.lookup-results li:hover {
  /* border-color: var(--clr-pink); */
  /* background: rgba(236, 147, 176, 0.05); */
  transform: translateY(-2px);
}

.divider {
  margin: 48px 0;
  text-align: center;
  position: relative;
  color: #a0aec0;
  font-weight: 600;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #e2e8f0 20%,
    #e2e8f0 80%,
    transparent 100%
  );
  z-index: 1;
}

.divider span {
  background: #ffffff;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.no-appointment-section {
  text-align: center;
}

.no-appointment-section p {
  color: #718096;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* Signature Container */
.signature-container {
  margin-top: 40px;
  text-align: center;
}

.signature-instruction {
  color: #718096;
  margin-bottom: 20px;
  font-style: italic;
}

.signature-wrapper {
  display: inline-block;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  background: #ffffff;
  border: 3px solid #e2e8f0;
}

#signature-pad {
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
  width: 100%;
  max-width: 500px;
  height: 200px;
  display: block;
}

.signature-controls {
  padding: 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* Review Content */
.review-content {
  border-radius: 16px;
  margin-bottom: 40px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  padding: 10px;
}

.review-section {
  padding: 32px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.review-section:last-child {
  border-bottom: none;
}

.review-section h3 {
  margin: 0 0 24px 0;
  color: #2d3748;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  align-items: start;
}

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

.review-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.95rem;
}

.review-value {
  color: #2d3748;
  word-break: break-word;
  font-size: 0.95rem;
}

/* Notice Styles */
.pif-notice {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.pif-notice.info {

  border: 1px solid #b9dcff;
}
.pif-notice.error {
  background: #ffecec;
  border: 1px solid #ffb3b3;
  color: #a40000;
}
.pif-notice.success {
  background: #ecffef;
  border: 1px solid #b3ffbf;
  color: #0c6b2b;
}
.pif-notice.muted {
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
  .patient-intake-wrapper {
    padding: 15px 0;
  }

  .form-container {
    margin: 0 15px;
    border-radius: 16px;
  }

  .form-content {
    padding: 0 20px 20px;
  }

  .form-header {
    padding: 32px 24px;
  }

  .form-header h1 {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .radio-group,
  .checkbox-group {
    flex-direction: column;
    gap: 12px;
  }

  .step {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    margin: 0 20px;
  }

  .review-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .form-container {
    margin: 0 10px;
    border-radius: 12px;
  }

  .form-header h1 {
    font-size: 1.5rem;
  }

  .button-group {
    flex-direction: column;
    gap: 12px;
  }

  .patient-intake-wrapper button {
    width: 100%;
  }
}


/* --- MOBILE FIX PACK (paste after your existing CSS) --- */

/* small quality-of-life: stop iOS zoom-on-focus, keep text size stable */
.patient-intake-wrapper { -webkit-text-size-adjust: 100%; }

/* fix a tiny typo that can invalidate later rules in some browsers */
#appointment-lookup p { color: #ffffff !important; margin-bottom: 20px; }

/* ≤ 768px: make the step indicator scrollable & remove connector lines */
@media (max-width: 768px) {
  .step-indicator {
    display: none !important;
  }
}

/* tighten general spacing & make sections breathe better on phones */
@media (max-width: 768px) {
  .form-container { margin: 0 12px; border-radius: 14px; }
  .form-header { padding: 24px 18px; }
  .form-header h1 { font-size: 1.8rem; }
  .form-header .subtitle { font-size: 1rem; }

  .form-content { padding: 0 16px 18px; }

  .form-step h2 { font-size: 1.6rem; margin: 20px 0 12px; }
  .step-description { font-size: 1rem; margin-bottom: 24px; }

  .form-section {
    padding: 20px;           /* from 40px -> 20px */
    margin-bottom: 20px;
  }

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

  .radio-group, .checkbox-group {
    flex-direction: column;
    gap: 10px;
  }
  .radio-item, .checkbox-item {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
  }

  .patient-intake-wrapper input[type="text"],
  .patient-intake-wrapper input[type="email"],
  .patient-intake-wrapper input[type="date"],
  .patient-intake-wrapper input[type="tel"],
  .patient-intake-wrapper select,
  .patient-intake-wrapper textarea {
    padding: 14px 16px;
    font-size: 16px;
  }

  .button-group {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 20px;
  }
  .patient-intake-wrapper button { width: 100%; min-width: 0; }
}

/* very small phones: tighten further */
@media (max-width: 480px) {
  .form-container { margin: 0 8px; border-radius: 12px; }
  .form-header h1 { font-size: 1.5rem; }
  .form-section { padding: 16px; }
  .form-step h2 { font-size: 1.4rem; }

  /* signature area: ensure it fits */
  #signature-pad { max-width: 100%; height: 160px; }
}

/* prevent any sneaky horizontal scroll on body inside wrapper */
.patient-intake-wrapper { overflow-x: hidden; }


#pif_success_panel {
  background-color: #15215b;
  color: green;
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.5;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: fadeInScale 0.4s ease forwards;
}

#pif_success_panel  {
  font-weight: 600;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
