/* ===========================================
   Racery Talk With Us - Form Styles
   =========================================== */

/* ===========================================
   1. CSS VARIABLES
   =========================================== */
:root {
  /* Colors */
  --background: hsl(210 20% 98%);
  --foreground: hsl(222 47% 11%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(222 47% 11%);
  --border: hsl(214 20% 90%);
  --input: hsl(214 20% 85%);
  --primary: hsl(168 76% 42%);
  --primary-foreground: hsl(0 0% 100%);
  --secondary: hsl(210 40% 96%);
  --secondary-foreground: hsl(222 47% 20%);
  --muted: hsl(210 40% 96%);
  --muted-foreground: hsl(215 16% 47%);
  --accent: hsl(262 83% 58%);
  --accent-foreground: hsl(0 0% 100%);

  /* Button colors */
  --btn-blue: hsl(220 70% 40%);
  --btn-blue-hover: hsl(220 70% 35%);
  --btn-yellow: hsl(45 90% 50%);
  --btn-yellow-hover: hsl(45 90% 45%);
  --yellow-500: hsl(45 90% 50%);

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Spacing */
  --radius: 0.75rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);

  /* Shadows */
  --shadow-sm: 0 1px 2px -1px rgb(0 0 0 / 0.05), 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}

/* ===========================================
   2. BASE & RESET
   =========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: white;
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===========================================
   3. LAYOUT UTILITIES
   =========================================== */
.max-w-3xl {
  max-width: 48rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.pt-12 { padding-top: 3rem; }
.pb-24 { padding-bottom: 6rem; }
.pt-8 { padding-top: 2rem; }
.pt-12 { padding-top: 3rem; }
.pl-1 { padding-left: 0.25rem; }
.pl-7 { padding-left: 1.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-20 { margin-top: 5rem; }
.ml-2 { margin-left: 0.5rem; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flexbox */
.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* Spacing */
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-10 > * + * { margin-top: 2.5rem; }

/* ===========================================
   4. TYPOGRAPHY
   =========================================== */
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-display { font-family: var(--font-display); }

.tracking-tight { letter-spacing: -0.025em; }
.leading-relaxed { line-height: 1.625; }

/* ===========================================
   5. COLORS
   =========================================== */
.bg-white { background-color: white; }
.bg-muted { background-color: var(--muted); }
.bg-card { background-color: var(--card); }
.bg-yellow-400 { background-color: hsl(45 93% 58%); }

.text-foreground { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-yellow-500 { color: var(--yellow-500); }
.text-btn-blue { color: var(--btn-blue); }
.text-red-500 { color: hsl(0 84% 60%); }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }

.border-border { border-color: var(--border); }
.border-t { border-top: 1px solid var(--border); }

/* ===========================================
   6. SIZING
   =========================================== */
.w-full { width: 100%; }
.w-24 { width: 6rem; }
.w-4 { width: 1rem; }
.h-1 { height: 0.25rem; }
.h-4 { height: 1rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-64 { height: 16rem; }
.min-h-\[100px\] { min-height: 100px; }
.min-h-100 { min-height: 100px; }
.w-60 { width: 15rem; }

/* ===========================================
   7. BORDER & RADIUS
   =========================================== */
.rounded { border-radius: var(--radius); }
.rounded-xl { border-radius: var(--radius-xl); }
.border { border: 1px solid var(--border); }

/* ===========================================
   8. EFFECTS
   =========================================== */
.shadow { box-shadow: var(--shadow); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.overflow-hidden { overflow: hidden; }
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================================
   9. POSITIONING
   =========================================== */
.relative { position: relative; }
.absolute { position: absolute; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ===========================================
   10. TRANSITIONS
   =========================================== */
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-500 { transition-duration: 500ms; }

/* ===========================================
   11. MISC
   =========================================== */
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.object-cover { object-fit: cover; }

.hover-underline:hover { text-decoration: underline; }
.hover-text-primary:hover { color: var(--primary); }

/* ===========================================
   12. BUTTONS
   =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 150ms ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-yellow {
  background-color: var(--btn-yellow);
  color: var(--foreground);
}

.btn-yellow:hover {
  background-color: var(--btn-yellow-hover);
}

/* ===========================================
   13. FORM INPUTS
   =========================================== */
.form-input,
.form-textarea,
.form-select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(214 20% 85%);
  background-color: hsl(210 40% 98%);
  font-size: 1rem;
  outline: none;
  transition: all 150ms ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  background-color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted-foreground);
}

.form-textarea {
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* ===========================================
   14. CHECKBOX STYLING
   =========================================== */
.form-checkbox {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid hsl(214 20% 85%);
  border-radius: 0.25rem;
  background-color: white;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 150ms ease;
}

.form-checkbox:checked {
  background-color: var(--btn-yellow);
  border-color: var(--btn-yellow);
}

.form-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.5rem;
  height: 0.75rem;
  border: solid var(--foreground);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.form-checkbox:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===========================================
   15. RADIO STYLING
   =========================================== */
.form-radio {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid hsl(214 20% 85%);
  border-radius: 50%;
  background-color: white;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 150ms ease;
}

.form-radio:checked {
  border-color: var(--btn-yellow);
  border-width: 5px;
}

.form-radio:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===========================================
   16. EXPANDABLE SECTIONS
   =========================================== */
[data-expandable] .expandable-content {
  transition: height 300ms ease;
}

[data-expandable].expanded .expandable-content {
  height: auto !important;
}

[data-expandable].expanded .expandable-gradient {
  display: none;
}

.expandable-gradient {
  background: linear-gradient(to top, white, rgba(255, 255, 255, 0.8), transparent);
}

.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
}

.expand-btn .show-less {
  display: none;
}

[data-expandable].expanded + .expand-btn .show-more {
  display: none;
}

[data-expandable].expanded + .expand-btn .show-less {
  display: inline;
}

/* ===========================================
   17. CONDITIONAL FIELDS
   =========================================== */
.conditional-field {
  transition: opacity 200ms ease, max-height 200ms ease;
}

.conditional-field.hidden {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
}

.conditional-field:not(.hidden) {
  opacity: 1;
  max-height: 200px;
}

/* ===========================================
   18. CAROUSEL
   =========================================== */
.carousel-container {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 1rem;
}

.carousel-item {
  flex-shrink: 0;
}

/* ===========================================
   19. TOOLTIP
   =========================================== */
.tooltip-trigger {
  display: inline-flex;
  cursor: help;
}

.tooltip-trigger:hover {
  opacity: 0.7;
}

/* ===========================================
   20. RESPONSIVE
   =========================================== */
@media (min-width: 640px) {
  .sm-px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .sm-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm-w-auto {
    width: auto;
  }
}

@media (min-width: 768px) {
  .md-text-5xl {
    font-size: 3rem;
    line-height: 1.2;
  }

  .md-text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .md-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-p-8 {
    padding: 2rem;
  }
}