/* ============================================================
   PlantGuard Design System — Base / Reset (3D PREMIUM EDITION)
   Global resets, base element styles, and shared utility classes.
   Depends on tokens.css being loaded first.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  background: var(--gradient-hero-mesh);
  background-attachment: fixed;
  color: var(--color-neutral-800);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection {
  background: var(--color-accent-400);
  color: var(--color-brand-950);
}

/* Slim premium scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-brand-300), var(--color-brand-500));
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  color: var(--color-brand-800);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.015em;
}

p { margin: 0 0 var(--space-3) 0; color: var(--color-neutral-700); }

a { color: var(--color-brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding-left: 1.1em; }
li { margin-bottom: var(--space-1); }

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

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

/* ---- Visible focus states everywhere (Phase 24 accessibility) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* ---- Skip link (keyboard navigation) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gradient-brand-deep);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-modal);
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
  left: 0;
}

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

/* ---- Layout utilities ---- */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.page-main { flex: 1 0 auto; }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--color-neutral-500); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }

/* ---- Grid helpers ---- */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

/* ---- Section spacing ---- */
.section { padding: var(--space-12) 0; }
.section-title {
  font-size: var(--font-size-2xl);
  color: var(--color-brand-800);
  letter-spacing: -0.02em;
}
.section-subtitle {
  color: var(--color-neutral-500);
  font-size: var(--font-size-sm);
  margin-top: calc(-1 * var(--space-2));
}

/* ---- Print (Phase 16: diagnosis report) ---- */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
}
