/*
 * ─────────────────────────────────────────────────────────────────────
 *  ZEVPOINT CUSTOMER PORTAL — DESIGN SYSTEM
 *  Restrained, mobile-first, calmly professional. Confidence comes from
 *  space and type, not effects. No grain, no atmospheric gradients,
 *  no glow. Hairline borders, one accent colour, generous whitespace.
 *
 *  Single source of truth for tokens + primitives across every customer
 *  surface on my.zevpoint.com.
 * ─────────────────────────────────────────────────────────────────────
 */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, li, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }

/* ─── Tokens ─── */
:root {
  /* Brand */
  --zp-ink:           #0f3a48;
  --zp-ink-soft:      #234c5a;
  --zp-sage:          #2e9d5f;       /* primary action — slightly muted from #54b474 for less candy feel */
  --zp-sage-deep:     #248049;

  /* Surfaces */
  --zp-bg:            #ffffff;        /* pure white page */
  --zp-surface:       #ffffff;
  --zp-surface-mute:  #f5f7f6;        /* subtle gray-tinted off-white */

  /* Text */
  --zp-text:          #0f3a48;
  --zp-text-muted:    #5a6b73;
  --zp-text-subtle:   #8a98a0;
  --zp-text-faint:    #b8c2c8;

  /* Borders — hairline, ink-tinted */
  --zp-border:        #e4e8eb;
  --zp-border-strong: #cfd6da;
  --zp-divider:       #eef1f2;

  /* Status (single neutral + sage success + amber warning + red danger) */
  --zp-success-fg:    #1f7a47;
  --zp-success-bg:    #e8f5ee;
  --zp-success-border:#c4e3d1;

  --zp-warning-fg:    #8a4a09;
  --zp-warning-bg:    #fdf5e6;
  --zp-warning-border:#f0d9a8;

  --zp-danger-fg:     #9c2222;
  --zp-danger-bg:     #fcebeb;
  --zp-danger-border: #efc5c5;

  --zp-neutral-fg:    #3a4a52;
  --zp-neutral-bg:    #f0f3f4;
  --zp-neutral-border:#dde2e5;

  /* Type — single family. Body and display both use Montserrat. */
  --zp-font-sans:     'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --zp-text-xs:       11px;
  --zp-text-sm:       13px;
  --zp-text-base:     15px;
  --zp-text-lg:       17px;
  --zp-text-xl:       20px;
  --zp-text-2xl:      24px;
  --zp-text-3xl:      28px;

  --zp-weight-regular:  400;
  --zp-weight-medium:   500;
  --zp-weight-semibold: 600;
  --zp-weight-bold:     700;

  --zp-leading-tight:   1.2;
  --zp-leading-snug:    1.35;
  --zp-leading-normal:  1.5;

  --zp-tracking-tight:  -0.015em;
  --zp-tracking-eyebrow: 0.10em;

  /* Spacing (4pt grid) */
  --zp-space-1:  4px;
  --zp-space-2:  8px;
  --zp-space-3:  12px;
  --zp-space-4:  16px;
  --zp-space-5:  20px;
  --zp-space-6:  24px;
  --zp-space-7:  32px;
  --zp-space-8:  40px;
  --zp-space-9:  56px;
  --zp-space-10: 72px;

  /* Radius */
  --zp-radius-xs:   6px;
  --zp-radius-sm:   10px;
  --zp-radius-md:   12px;
  --zp-radius-lg:   16px;
  --zp-radius-pill: 999px;

  /* Shadow — almost imperceptible */
  --zp-shadow-xs:  0 1px 2px rgba(15, 58, 72, 0.04);
  --zp-shadow-sm:  0 1px 3px rgba(15, 58, 72, 0.05);

  /* Motion */
  --zp-ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --zp-dur-fast:   150ms;
  --zp-dur-base:   240ms;

  /* Layout — mobile-first; widens on tablet+ */
  --zp-container:    520px;
  --zp-container-pad: 20px;
}

/* ─── Base ─── */
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: var(--zp-font-sans);
  font-size: var(--zp-text-base);
  font-weight: var(--zp-weight-regular);
  line-height: var(--zp-leading-normal);
  color: var(--zp-text);
  background: var(--zp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Avoid font-loading layout shift — fall back to system font until Montserrat ready */
  font-display: swap;
}

/* ─── Layout container ─── */
.zp-app {
  width: 100%;
  max-width: var(--zp-container);
  margin: 0 auto;
  padding: 0 var(--zp-container-pad) var(--zp-space-10);
  /* iOS safe-area bottom (notches/home indicators) */
  padding-bottom: calc(var(--zp-space-10) + env(safe-area-inset-bottom, 0px));
}

/* ─── Accessibility ─── */

/* Keyboard-only focus ring. Mouse users won't see it; keyboard /
   screen-reader users get a clear visible target. 2024 best practice
   is :focus-visible rather than :focus (which would also fire on
   pointer interactions and feel noisy). */
*:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--zp-sage);
  outline-offset: 2px;
  border-radius: var(--zp-radius-xs);
}

/* Skip-to-main-content link. Invisible until focused, then jumps
   into a visible pill at the top of the viewport. Required so
   keyboard users don't have to tab through the topbar on every page. */
.zp-skip {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--zp-ink);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 0 0 var(--zp-radius-md) var(--zp-radius-md);
  font-size: var(--zp-text-sm);
  font-weight: var(--zp-weight-semibold);
  text-decoration: none;
  z-index: 1000;
  transition: top var(--zp-dur-fast) var(--zp-ease);
}
.zp-skip:focus,
.zp-skip:focus-visible {
  top: 0;
  outline: 2px solid var(--zp-sage);
  outline-offset: -2px;
}

/* Screen-reader-only utility for visually-hidden text. */
.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;
}

/* Respect reduced-motion preference. Disables all animations + scale
   transitions site-wide for users with vestibular disorders. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── Typography utilities ─── */
.zp-eyebrow {
  font-size: var(--zp-text-xs);
  font-weight: var(--zp-weight-semibold);
  letter-spacing: var(--zp-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--zp-text-subtle);
}
.zp-title {
  font-size: var(--zp-text-lg);
  font-weight: var(--zp-weight-semibold);
  line-height: var(--zp-leading-snug);
  color: var(--zp-text);
}
.zp-body { font-size: var(--zp-text-base); color: var(--zp-text); }
.zp-caption {
  font-size: var(--zp-text-sm);
  line-height: var(--zp-leading-normal);
  color: var(--zp-text-muted);
}
.zp-muted   { color: var(--zp-text-muted) !important; }
.zp-subtle  { color: var(--zp-text-subtle) !important; }

/* ─── Card primitive ─── */
.zp-card {
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-lg);
  overflow: hidden;
}
.zp-card-body { padding: var(--zp-space-5); }

/* ─── Pill / badge ─── */
.zp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--zp-radius-pill);
  font-size: var(--zp-text-xs);
  font-weight: var(--zp-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--zp-neutral-bg);
  color: var(--zp-neutral-fg);
  border: 1px solid var(--zp-neutral-border);
  white-space: nowrap;
}
.zp-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.zp-pill--success { background: var(--zp-success-bg); color: var(--zp-success-fg); border-color: var(--zp-success-border); }
.zp-pill--warning { background: var(--zp-warning-bg); color: var(--zp-warning-fg); border-color: var(--zp-warning-border); }
.zp-pill--danger  { background: var(--zp-danger-bg);  color: var(--zp-danger-fg);  border-color: var(--zp-danger-border); }

/* ─── Button ─── */
.zp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zp-space-2);
  min-height: 48px;        /* mobile touch target */
  padding: 0 var(--zp-space-5);
  border-radius: var(--zp-radius-md);
  font-size: var(--zp-text-base);
  font-weight: var(--zp-weight-semibold);
  border: 1px solid transparent;
  transition: background var(--zp-dur-fast) var(--zp-ease),
              border-color var(--zp-dur-fast) var(--zp-ease),
              transform var(--zp-dur-fast) var(--zp-ease);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.zp-btn:active { transform: scale(0.98); }
.zp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.zp-btn--primary {
  background: var(--zp-sage);
  color: #fff;
}
.zp-btn--primary:hover { background: var(--zp-sage-deep); }

.zp-btn--secondary {
  background: var(--zp-surface);
  color: var(--zp-text);
  border-color: var(--zp-border-strong);
}
.zp-btn--secondary:hover { background: var(--zp-surface-mute); border-color: var(--zp-text-subtle); }

.zp-btn--full { width: 100%; }
.zp-btn--sm { min-height: 36px; padding: 0 var(--zp-space-4); font-size: var(--zp-text-sm); }
.zp-btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── Avatar ─── */
.zp-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: var(--zp-weight-semibold);
  font-size: var(--zp-text-base);
  color: var(--zp-ink);
  background: var(--zp-surface-mute);
  border: 1px solid var(--zp-border);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ─── Utility ─── */
.zp-hidden { display: none !important; }
.zp-stack > * + * { margin-top: var(--zp-space-4); }
.zp-stack-tight > * + * { margin-top: var(--zp-space-2); }

.zp-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--zp-space-3);
}

/* ─── Motion — ONE subtle entry; nothing else ─── */
@keyframes zp-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.zp-anim-fade { animation: zp-fade var(--zp-dur-base) var(--zp-ease) both; }

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

/* ─── Focus ring (keyboard accessibility) ─── */
:focus-visible {
  outline: 2px solid var(--zp-sage);
  outline-offset: 2px;
  border-radius: var(--zp-radius-xs);
}
