/* =============================================
   FabricAI — Base Styles & Global Reset
   styles/base.css
   ============================================= */

/* ─── Modern CSS Reset ──────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  background-image: var(--gradient-mesh);
  background-attachment: fixed;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─── Typography Defaults ───────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-text-brand);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-brand-300);
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ─── Focus Styles (Accessibility) ─────────── */
:focus-visible {
  outline: 2px solid var(--color-brand-400);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Remove focus ring when using mouse */
:focus:not(:focus-visible) {
  outline: none;
}

/* ─── Selection Colors ──────────────────────── */
::selection {
  background-color: hsla(263, 70%, 58%, 0.3);
  color: var(--color-text-primary);
}

/* ─── Custom Scrollbar (WebKit) ─────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-700);
}

/* ─── Custom Scrollbar (Firefox) ───────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

/* ─── Animated Background Orbs ─────────────── */
body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.35;
  z-index: var(--z-below);
}

body::before {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, hsl(263, 70%, 40%) 0%, transparent 70%);
  animation: orbFloat1 20s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -150px;
  background: radial-gradient(circle, hsl(243, 65%, 35%) 0%, transparent 70%);
  animation: orbFloat2 25s ease-in-out infinite;
}

/* ─── Layout Containers ─────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--md {
  max-width: var(--container-md);
}

.container--sm {
  max-width: var(--container-sm);
}

/* ─── Section Base ──────────────────────────── */
.section {
  padding-block: var(--section-gap);
}

/* ─── Card Base ─────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-slow);
}

.card:hover {
  border: var(--glass-border-hover);
  box-shadow: var(--shadow-xl);
}

/* ─── Utility Classes ───────────────────────── */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Text utilities */
.text-center { text-align: center; }
.text-brand { color: var(--color-text-brand); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-tertiary); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: var(--weight-bold); }
.font-semibold { font-weight: var(--weight-semibold); }

/* Spacing */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ─── App Page Manager ──────────────────────── */
.page {
  width: 100%;
  min-height: 100dvh;
}

.page--hidden {
  display: none !important;
}

/* ─── Step Section ──────────────────────────── */
.step-section {
  margin-bottom: var(--space-12);
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}

.step-title {
  font-size: var(--text-xl);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.step-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

/* ─── Divider ───────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-default), transparent);
  margin-block: var(--space-10);
}

/* ─── Badge ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.badge--brand {
  background: var(--gradient-brand-soft);
  color: var(--color-text-brand);
  border: 1px solid hsla(263, 60%, 55%, 0.3);
}

.badge--success {
  background: var(--color-success-soft);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

/* ─── Loading Skeleton ──────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-elevated) 0%,
    var(--color-bg-overlay) 50%,
    var(--color-bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
