/* ============================================================
   onboard.css — Form-specific styles for bellarineai.com.au/onboard
   Companion to Tailwind CDN. Brand: Bellarine AI
   ============================================================ */

/* ── Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: #060C14;
  color: #F5F7FA;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
}

/* ── Sticky Nav ──────────────────────────────────────────── */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: #060C14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-bar.scrolled {
  background-color: rgba(6, 12, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar-wrap {
  position: sticky;
  top: 57px; /* height of nav */
  z-index: 40;
  background-color: rgba(6, 12, 20, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #006CB9 0%, #53AB2E 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-label {
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  color: #999CA5;
  letter-spacing: 0.02em;
}

/* ── Glass Card (form variant) ───────────────────────────── */
.glass-card {
  background: rgba(20, 48, 79, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}

.form-section-card {
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 28px;
  transition: border-color 0.2s ease;
}

.form-section-card:focus-within {
  border-color: rgba(0, 108, 185, 0.3);
}

/* ── Section Badge ───────────────────────────────────────── */
.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #006CB9, #00438F);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Labels ──────────────────────────────────────────────── */
.field-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #F5F7FA;
  margin-bottom: 6px;
  line-height: 1.4;
}

.field-label .required-star {
  color: #53AB2E;
  margin-left: 3px;
}

.field-hint {
  display: block;
  font-size: 11.5px;
  color: #999CA5;
  margin-top: 3px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ── Text Inputs & Textareas ─────────────────────────────── */
.form-input,
.form-textarea {
  width: 100%;
  background: #0a1628;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #F5F7FA;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #545A67;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #006CB9;
  box-shadow: 0 0 0 3px rgba(0, 108, 185, 0.18), 0 0 12px rgba(0, 108, 185, 0.12);
}

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

.form-input[type="tel"],
.form-input[type="email"],
.form-input[type="url"] {
  /* inherit base styles — no overrides needed */
}

/* Error state */
.form-input.error,
.form-textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-error {
  display: none;
  font-size: 12px;
  color: #f87171;
  margin-top: 5px;
  font-family: 'Inter', sans-serif;
}

.field-error.visible {
  display: block;
  animation: fadeInDown 0.2s ease;
}

/* ── Custom Checkboxes ───────────────────────────────────── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #F5F7FA;
  font-family: 'Inter', sans-serif;
  user-select: none;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 22, 40, 0.4);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-label:hover {
  background: rgba(0, 108, 185, 0.1);
  border-color: rgba(0, 108, 185, 0.25);
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: #0a1628;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
  background: #006CB9;
  border-color: #006CB9;
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-label:has(input:checked) {
  background: rgba(0, 108, 185, 0.12);
  border-color: rgba(0, 108, 185, 0.4);
  color: #F5F7FA;
}

/* ── Custom Radio Buttons ────────────────────────────────── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #F5F7FA;
  font-family: 'Inter', sans-serif;
  user-select: none;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 22, 40, 0.4);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.radio-label:hover {
  background: rgba(0, 108, 185, 0.1);
  border-color: rgba(0, 108, 185, 0.25);
}

.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: #0a1628;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  cursor: pointer;
}

.radio-label input[type="radio"]:checked {
  border-color: #006CB9;
  background: #0a1628;
}

.radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #006CB9;
}

.radio-label:has(input:checked) {
  background: rgba(0, 108, 185, 0.12);
  border-color: rgba(0, 108, 185, 0.4);
}

/* ── Focus-visible rings for custom checkbox/radio ───────── */
.checkbox-label input[type="checkbox"]:focus-visible,
.radio-label input[type="radio"]:focus-visible {
  outline: 2px solid #006CB9;
  outline-offset: 2px;
}

/* ── Submit Button ───────────────────────────────────────── */
.btn-gradient {
  background: linear-gradient(135deg, #006CB9 0%, #53AB2E 100%);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-gradient:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(83, 171, 46, 0.32), 0 0 40px rgba(0, 108, 185, 0.2);
}

.btn-gradient:active:not(:disabled) {
  transform: translateY(0);
}

.btn-gradient:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner inside button */
.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* ── Text Gradient ───────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, #006CB9 0%, #53AB2E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Success State ───────────────────────────────────────── */
#success-state {
  display: none;
  opacity: 0;
}

#success-state.visible {
  display: block;
  animation: fadeInUp 0.5s ease forwards;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(83, 171, 46, 0.2), rgba(0, 108, 185, 0.2));
  border: 2px solid rgba(83, 171, 46, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

/* ── Error Banner ────────────────────────────────────────── */
#submit-error {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fca5a5;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  margin-top: 16px;
  animation: fadeInDown 0.2s ease;
}

#submit-error.visible {
  display: block;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 768px) {
  .form-section-card {
    padding: 36px 32px;
  }

  .progress-bar-wrap {
    padding: 12px 24px;
  }

  .checkbox-group,
  .radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Override grid for groups with longer option text */
  .radio-group.single-col,
  .checkbox-group.single-col {
    display: flex;
    flex-direction: column;
  }
}

@media (min-width: 1140px) {
  .form-section-card {
    padding: 40px 40px;
  }
}

/* ── Field row spacing ───────────────────────────────────── */
.field-wrap {
  margin-bottom: 22px;
}

.field-wrap:last-child {
  margin-bottom: 0;
}

/* ── Hero time badge ─────────────────────────────────────── */
.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: #999CA5;
  font-family: 'Inter', sans-serif;
}

/* ── Scroll-to-error highlight ───────────────────────────── */
.form-input.highlight-error,
.form-textarea.highlight-error {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
  80%       { transform: translateX(-3px); }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
