/* ==========================================================================
   Healthcare Software Demo Request Form — IB Software
   Design: Clean, modern SaaS-style (Tally-inspired) with healthcare blue & teal accents
   ========================================================================== */

:root {
  --hs-teal: #0d9488;
  --hs-teal-dark: #0f766e;
  --hs-teal-light: #f0fdfa;
  --hs-teal-border: #99f6e4;
  --hs-blue: #0284c7;
  --hs-blue-dark: #0369a1;
  --hs-blue-light: #f0f9ff;
  --hs-blue-border: #bae6fd;
  --hs-navy: #152238;
  --hs-navy-mid: #1e3352;
  --hs-gray-50: #f8fafc;
  --hs-gray-100: #f1f5f9;
  --hs-gray-200: #e2e8f0;
  --hs-gray-300: #cbd5e1;
  --hs-gray-400: #94a3b8;
  --hs-gray-500: #64748b;
  --hs-gray-700: #334155;
  --hs-gray-900: #0f172a;
  --hs-error: #dc2626;
  --hs-error-light: #fef2f2;
  --hs-error-border: #fecaca;
  --hs-success: #16a34a;
  --hs-success-light: #f0fdf4;
  --hs-success-border: #bbf7d0;
  --hs-radius: 12px;
  --hs-radius-sm: 8px;
  --hs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --hs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --hs-shadow-lg: 0 12px 28px -4px rgba(21, 34, 56, 0.08), 0 4px 10px -2px rgba(21, 34, 56, 0.04);
  --hs-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

/* Container & Layout */
.hs-demo-wrapper {
  font-family: var(--hs-font);
  color: var(--hs-gray-900);
  line-height: 1.6;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hs-demo-card {
  background: #ffffff;
  border: 1px solid var(--hs-gray-200);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow-lg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hs-demo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--hs-teal) 0%, var(--hs-blue) 50%, var(--hs-navy) 100%);
}

/* Header */
.hs-form-header {
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--hs-gray-100);
  padding-bottom: 1.5rem;
}

.hs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hs-teal-dark);
  background: var(--hs-teal-light);
  border: 1px solid var(--hs-teal-border);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.hs-badge svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.hs-form-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--hs-navy);
  margin: 0 0 0.5rem;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.hs-form-subtitle {
  font-size: 1rem;
  color: var(--hs-gray-500);
  margin: 0;
  max-width: 68ch;
  line-height: 1.65;
}

/* Form Sections and Field Groups */
.hs-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hs-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.hs-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hs-gray-900);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hs-required {
  color: var(--hs-error);
  font-weight: 700;
}

.hs-hint {
  font-size: 0.82rem;
  color: var(--hs-gray-500);
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
}

/* Text Inputs and Textarea */
.hs-input,
.hs-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--hs-gray-900);
  background: #ffffff;
  border: 1px solid var(--hs-gray-300);
  border-radius: var(--hs-radius-sm);
  padding: 0.85rem 1rem;
  line-height: 1.5;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.hs-input:hover,
.hs-textarea:hover {
  border-color: var(--hs-gray-400);
}

.hs-input:focus,
.hs-textarea:focus {
  border-color: var(--hs-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.hs-input::placeholder,
.hs-textarea::placeholder {
  color: var(--hs-gray-400);
}

.hs-input[aria-invalid="true"],
.hs-textarea[aria-invalid="true"],
.hs-has-error .hs-input,
.hs-has-error .hs-textarea,
.hs-has-error .hs-country-trigger,
.hs-has-error .hs-options-grid {
  border-color: var(--hs-error) !important;
}

.hs-has-error .hs-input:focus,
.hs-has-error .hs-textarea:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.hs-textarea {
  resize: vertical;
  min-height: 110px;
}

/* Option Cards: Radio & Checkbox grids (Tally-style) */
.hs-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.hs-options-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.hs-options-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

.hs-options-grid--4col {
  grid-template-columns: repeat(4, 1fr);
}

.hs-choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--hs-gray-50);
  border: 1.5px solid var(--hs-gray-200);
  border-radius: var(--hs-radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.hs-choice-card:hover {
  background: #ffffff;
  border-color: var(--hs-blue-border);
  transform: translateY(-1px);
}

.hs-choice-card.is-selected {
  background: var(--hs-blue-light);
  border-color: var(--hs-blue);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1);
}

.hs-choice-card input[type="radio"],
.hs-choice-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.hs-choice-card:focus-within {
  outline: none;
  border-color: var(--hs-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

/* Custom indicator icon (circle or checkbox) */
.hs-indicator {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--hs-gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: all 0.18s ease;
}

.hs-choice-card--checkbox .hs-indicator {
  border-radius: 5px;
}

.hs-choice-card.is-selected .hs-indicator {
  background: var(--hs-blue);
  border-color: var(--hs-blue);
}

.hs-indicator svg {
  width: 12px;
  height: 12px;
  fill: #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.18s ease;
}

.hs-choice-card.is-selected .hs-indicator svg {
  opacity: 1;
  transform: scale(1);
}

.hs-choice-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.hs-choice-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--hs-gray-900);
  line-height: 1.35;
}

.hs-choice-card.is-selected .hs-choice-title {
  color: var(--hs-blue-dark);
}

.hs-choice-desc {
  font-size: 0.78rem;
  color: var(--hs-gray-500);
  margin-top: 0.15rem;
}

.hs-choice-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--hs-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-choice-card.is-selected .hs-choice-icon {
  color: var(--hs-blue-dark);
}

/* Searchable Country Selector */
.hs-country-select {
  position: relative;
  width: 100%;
}

.hs-country-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border: 1px solid var(--hs-gray-300);
  border-radius: var(--hs-radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--hs-gray-900);
  transition: all 0.2s ease;
  user-select: none;
}

.hs-country-trigger:hover {
  border-color: var(--hs-gray-400);
}

.hs-country-trigger:focus,
.hs-country-select.is-open .hs-country-trigger {
  border-color: var(--hs-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  outline: none;
}

.hs-country-selected {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hs-country-flag {
  font-size: 1.25rem;
  line-height: 1;
}

.hs-chevron {
  width: 16px;
  height: 16px;
  color: var(--hs-gray-400);
  transition: transform 0.2s ease;
}

.hs-country-select.is-open .hs-chevron {
  transform: rotate(180deg);
}

.hs-country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid var(--hs-gray-200);
  border-radius: var(--hs-radius-sm);
  box-shadow: var(--hs-shadow-lg);
  max-height: 290px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: hsFadeDown 0.15s ease-out;
}

.hs-country-select.is-open .hs-country-dropdown {
  display: flex;
}

@keyframes hsFadeDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hs-country-search-wrap {
  padding: 0.65rem;
  background: var(--hs-gray-50);
  border-bottom: 1px solid var(--hs-gray-200);
  position: sticky;
  top: 0;
  z-index: 2;
}

.hs-country-search {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  border: 1px solid var(--hs-gray-300);
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  box-sizing: border-box;
}

.hs-country-search:focus {
  border-color: var(--hs-blue);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.hs-country-list {
  overflow-y: auto;
  max-height: 220px;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.hs-country-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--hs-gray-700);
  cursor: pointer;
  transition: background 0.12s ease;
}

.hs-country-item:hover,
.hs-country-item.is-highlighted {
  background: var(--hs-blue-light);
  color: var(--hs-blue-dark);
}

.hs-country-item.is-selected {
  font-weight: 600;
  color: var(--hs-blue-dark);
  background: rgba(2, 132, 199, 0.08);
}

.hs-country-empty {
  padding: 1rem;
  font-size: 0.88rem;
  color: var(--hs-gray-400);
  text-align: center;
}

/* Error Messages */
.hs-error-msg {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--hs-error);
  margin-top: 0.2rem;
}

.hs-has-error .hs-error-msg {
  display: flex;
}

.hs-error-msg svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}

/* Privacy & Footer Actions */
.hs-form-footer {
  border-top: 1px solid var(--hs-gray-100);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hs-privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--hs-gray-500);
  background: var(--hs-gray-50);
  border: 1px solid var(--hs-gray-200);
  border-radius: var(--hs-radius-sm);
  padding: 0.75rem 1rem;
}

.hs-privacy-icon {
  width: 16px;
  height: 16px;
  color: var(--hs-teal);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.hs-privacy-notice strong {
  color: var(--hs-gray-700);
  font-weight: 600;
}

.hs-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hs-submit-note {
  font-size: 0.82rem;
  color: var(--hs-gray-400);
}

.hs-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 2rem;
  background: var(--hs-navy);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--hs-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
  box-shadow: 0 2px 4px rgba(21, 34, 56, 0.12);
}

.hs-btn-submit:hover:not(:disabled) {
  background: var(--hs-navy-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(21, 34, 56, 0.18);
}

.hs-btn-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.35);
}

.hs-btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.hs-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: hsSpin 0.7s linear infinite;
}

.is-submitting .hs-spinner {
  display: inline-block;
}

.is-submitting .hs-btn-arrow {
  display: none;
}

@keyframes hsSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Notifications: Error Banner & Success Screen */
.hs-alert {
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--hs-radius-sm);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.hs-alert.is-visible {
  display: flex;
}

.hs-alert--error {
  background: var(--hs-error-light);
  border: 1px solid var(--hs-error-border);
  color: #991b1b;
}

.hs-alert--error svg {
  width: 20px;
  height: 20px;
  fill: #dc2626;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.hs-alert--info {
  background: var(--hs-blue-light);
  border: 1px solid var(--hs-blue-border);
  color: var(--hs-blue-dark);
}

.hs-alert--info svg {
  width: 20px;
  height: 20px;
  fill: var(--hs-blue);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Success Card */
.hs-success-state {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
}

.hs-success-state.is-visible {
  display: block;
}

.hs-success-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--hs-success-light);
  border: 2px solid var(--hs-success-border);
  color: var(--hs-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hs-success-icon-wrap svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.hs-success-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--hs-navy);
  margin: 0 0 0.75rem;
}

.hs-success-msg {
  font-size: 1.05rem;
  color: var(--hs-gray-700);
  max-width: 50ch;
  margin: 0 auto 1.75rem;
  line-height: 1.65;
}

.hs-success-summary {
  background: var(--hs-gray-50);
  border: 1px solid var(--hs-gray-200);
  border-radius: var(--hs-radius-sm);
  padding: 1.25rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  text-align: left;
  font-size: 0.88rem;
}

.hs-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--hs-gray-200);
}

.hs-summary-row:last-child {
  border-bottom: none;
}

.hs-summary-label {
  color: var(--hs-gray-500);
  font-weight: 500;
}

.hs-summary-val {
  color: var(--hs-gray-900);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.hs-btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  color: var(--hs-gray-700);
  border: 1px solid var(--hs-gray-300);
  border-radius: var(--hs-radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hs-btn-reset:hover {
  background: var(--hs-gray-50);
  border-color: var(--hs-gray-400);
  color: var(--hs-navy);
}

/* Integration Mode Switcher (For Native Form vs Tally Embed) */
.hs-mode-switch {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  background: var(--hs-gray-100);
  padding: 0.35rem;
  border-radius: 9999px;
  width: fit-content;
  margin-inline: auto;
}

.hs-mode-btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--hs-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hs-mode-btn.is-active {
  background: #ffffff;
  color: var(--hs-navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hs-tally-container {
  display: none;
  min-height: 580px;
}

.hs-tally-container.is-active {
  display: block;
}

.hs-tally-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: var(--hs-radius-sm);
}

/* Honeypot field (hidden from human users) */
.hs-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hs-demo-card {
    padding: 1.75rem 1.25rem;
    border-radius: 12px;
  }

  .hs-form-title {
    font-size: 1.5rem;
  }

  .hs-form-subtitle {
    font-size: 0.92rem;
  }

  .hs-options-grid--2col,
  .hs-options-grid--3col,
  .hs-options-grid--4col {
    grid-template-columns: 1fr;
  }

  .hs-options-grid {
    grid-template-columns: 1fr;
  }

  .hs-submit-bar {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .hs-btn-submit {
    width: 100%;
  }

  .hs-submit-note {
    text-align: center;
  }
}
