/*
 * Shared UI components — single source of truth for buttons, form inputs,
 * dialog primitives. Every page that needs these classes loads this file
 * AFTER tour.css so its declarations win over any leftover legacy rules.
 *
 * Goal: a button on /signin, /dashboard, /account, /landing renders
 * pixel-identical when it has the same role.
 *
 * Tokens used (sourced from tokens/tokens.json via _tokens.generated.css):
 *   --brand-primary, --brand-accent, --brand-highlight,
 *   --text-primary, --text-muted, --control-border,
 *   --button-secondary-border, --button-secondary-bg-hover,
 *   --button-secondary-border-hover
 */

/* Base button — shared geometry, typography, transitions. Every concrete
 * variant (.btn-primary, .btn-secondary, .btn-google) extends this. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Primary CTA — solid brand-green. Use for the main action on a page
 * (sign in, create tour, manage subscription). */
.btn-primary {
  background: var(--brand-primary);
  color: var(--text-primary);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-accent);
  transform: translateY(-1px);
}

/* Secondary action — outlined ghost. Use for sign out, cancel,
 * lower-priority actions next to a primary. */
.btn-secondary {
  background: transparent;
  border-color: var(--button-secondary-border);
  color: inherit;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--button-secondary-bg-hover);
  border-color: var(--button-secondary-border-hover);
}

/* Google sign-in — Google brand guidelines require white background,
 * dark text, specific weight. Don't change without checking the policy. */
.btn-google {
  padding: 0.75rem 1rem;
  background: #fff;
  color: #202124;
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 0.98rem;
  font-weight: 500;
}

.btn-google:hover:not(:disabled) {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/*
 * HubSpot embedded form overrides — match Immersia branding.
 *
 * hbspt.forms.create() renders the form inline in the DOM, so CSS from
 * this stylesheet can override HubSpot's default orange styling.
 *
 * Every color uses var(--…) tokens from tokens/tokens.json. When tokens
 * change, these overrides update automatically — no hardcoded hex values.
 *
 * Tokens used: --brand-highlight, --brand-highlight-hover, --brand-primary,
 *   --text-primary, --text-muted, --control-border, --control-border-strong,
 *   --surface-soft, --brand-shadow, --danger-base.
 */

/* Wrapper — constrain width to match the rest of the page layout. */
.hbspt-form {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* Form container */
.hbspt-form .hs-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Labels ─────────────────────────────────────────────────── */

.hbspt-form .hs-form-field > label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hbspt-form .hs-form-field > label .hs-form-required {
  color: var(--danger-base);
}

/* ── Inputs ─────────────────────────────────────────────────── */

.hbspt-form .hs-input,
.hbspt-form input.hs-input,
.hbspt-form textarea.hs-input,
.hbspt-form select.hs-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--control-border);
  border-radius: 0.375rem;
  background: var(--surface-soft);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.hbspt-form .hs-input::placeholder,
.hbspt-form input.hs-input::placeholder,
.hbspt-form textarea.hs-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.hbspt-form .hs-input:focus,
.hbspt-form input.hs-input:focus,
.hbspt-form textarea.hs-input:focus,
.hbspt-form select.hs-input:focus {
  border-color: var(--brand-highlight);
  box-shadow: 0 0 0 3px rgba(196, 149, 53, 0.15);
}

/* ── Submit button ──────────────────────────────────────────── */

.hbspt-form .hs-button,
.hbspt-form input.hs-button,
.hbspt-form .hs_submit .hs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: var(--brand-highlight);
  color: var(--brand-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hbspt-form .hs-button:hover:not(:disabled),
.hbspt-form input.hs-button:hover:not(:disabled) {
  background: var(--brand-highlight-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px var(--brand-shadow);
}

.hbspt-form .hs-button:active:not(:disabled),
.hbspt-form input.hs-button:active:not(:disabled) {
  transform: translateY(0);
}

.hbspt-form .hs-button:disabled,
.hbspt-form input.hs-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ── Error messages ─────────────────────────────────────────── */

.hbspt-form .hs-error-msgs {
  margin-top: 0.25rem;
  padding: 0;
  list-style: none;
}

.hbspt-form .hs-error-msgs label {
  font-size: 0.8125rem;
  color: var(--danger-base);
}

.hbspt-form .hs-error-msg {
  font-size: 0.8125rem;
  color: var(--danger-base);
}

/* Input border turns red on validation error */
.hbspt-form .hs-input.error,
.hbspt-form .hs-form-field.error .hs-input {
  border-color: var(--danger-base);
}

/* ── Success message ────────────────────────────────────────── */

.hbspt-form .submitted-message {
  padding: 1rem;
  border: 1px solid var(--control-border-strong);
  border-radius: 0.5rem;
  background: var(--surface-soft);
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: center;
}

/* ── Legal / consent text ───────────────────────────────────── */

.hbspt-form .hs-form-booleancheckbox-display {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hbspt-form .hs-form-booleancheckbox-display a {
  color: var(--brand-highlight);
  text-decoration: underline;
}
