/* MiN8T Tools - shared styles
   Brand tokens deliberately match the marketing site
   (https://min8t.com/landing/) so that switching between
   min8t.com/* and min8t.com/tools/* feels like one product.

   v2 - 2026-04-28: token rewrite to dark / mint-green theme.
   See IMPLEMENTATION/specs/FREE_TOOLS_BRAND_HARMONIZATION_SPEC.md §2.1
   in the Min8T monorepo for the rationale. */

:root {
  /* Brand palette */
  --brand-primary: #28ef91;            /* MiN8T mint green */
  --brand-primary-dark: #1ec97a;
  --brand-accent: #FFA94D;             /* warm amber */

  /* Neutrals - dark theme, glass surfaces above the wave background */
  --bg: #2b312c;                       /* MiN8T dark gray */
  --bg-alt: rgba(43, 49, 44, 0.52);    /* glass-pill bg */
  --bg-muted: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.55);

  /* Semantic */
  --success: #28ef91;
  --warning: #FFA94D;
  --danger: #ff6b6b;

  /* Type scale - matches landing fonts. The actual @font-face declarations
     live in landing/css/main.css, which tools also link in <head>. If a tool
     fails to link main.css for any reason, font-family gracefully falls back
     to Roboto then system sans. */
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'PP Neue Montreal', 'Roboto', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Shadows - softened against dark bg */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);

  /* Layout - widened from 960 to 1000 (20px per side) so body copy and
     control rows fit more comfortably without crowding the glass-card
     edge. Tools that need more (e.g. inbox-preview's email viewport)
     override --container-max in their own <style> block. */
  --container-max: 1000px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The body itself is transparent so the <img id="hero-bg"> wave
   (added in each tool's <body>, per spec §2.5) shows through.
   Fall-back background-color is the brand dark, so a tool that
   ships without the wave img still reads as a MiN8T page. */
body {
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Wave background - inserted as the first child of <body> in each tool's
   index.html (Phase 2). Pinned to the viewport, behind everything. */
#hero-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Page chrome sits above the wave */
.site-header,
main,
.site-footer,
footer {
  position: relative;
  z-index: 1;
}

/* Tool body card - was solid white in v1, now glass to read on the wave */
main {
  flex: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: var(--space-xl) auto;
  padding: var(--space-2xl);
  background: rgba(43, 49, 44, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}
@media (max-width: 600px) {
  main {
    margin: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
  }
}

/* Headings: only force white inside the dark glass <main> and tool-hero
   blocks. Outside (e.g. in the footer's light-bg cards), main.css's own
   h1/h2/h3 rule (color: #2b312c) takes effect naturally. This avoids
   the v2 regression where "Ready to start?" + "Stay up to date" were
   white-on-light = invisible. */
main h1, main h2, main h3,
.tools-hero h1, .tools-hero h2, .tools-hero h3 {
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.2;
}

main h1, .tools-hero h1 { font-size: 2.5rem; font-weight: 700; margin: 0 0 var(--space-md); }
main h2, .tools-hero h2 { font-size: 1.75rem; font-weight: 600; margin: var(--space-2xl) 0 var(--space-md); }
main h3, .tools-hero h3 { font-size: 1.25rem; font-weight: 600; margin: var(--space-xl) 0 var(--space-md); }

main p { margin: 0 0 var(--space-md); color: var(--text-secondary); }

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

button, .btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, color 0.15s;
}

.btn-primary {
  background: var(--brand-primary);
  color: #2b312c;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--brand-primary-dark);
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-primary);
  border-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-secondary:hover {
  border-color: var(--border-strong);
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  padding: var(--space-sm) var(--space-md);
  /* !important is required: the landing's main.css ships Tailwind's
     preflight which has
       input[type="text"], input[type="url"], ... { border: 0; background: transparent }
     with selector specificity (0,1,1) - beats our plain "input" rule
     (0,0,1) regardless of source order. !important short-circuits the
     specificity contest so our visible-by-default field border applies
     across every input type. */
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: var(--radius-md) !important;
  background: rgba(15, 18, 16, 0.85) !important;
  color: var(--text-primary) !important;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input:hover, textarea:hover, select:hover {
  border-color: rgba(255, 255, 255, 0.7) !important;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(40, 239, 145, 0.18) !important;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted) !important;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Site header - glass on dark, matching landing's nav aesthetic.
   The header.html partial uses .bg-black + .bg-menu-main from the landing
   main.css when imported alongside this file. These rules are the fallback
   styling for tools that don't (yet) link main.css. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
  background: rgba(26, 30, 27, 0.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  gap: var(--space-sm);
  color: var(--text-primary);
}
.site-logo img { height: 32px; width: auto; display: block; }
.site-logo:hover { text-decoration: none; opacity: 0.85; }
.site-nav { display: flex; gap: var(--space-lg); align-items: center; }
.site-nav a { color: var(--text-secondary); font-size: 0.95rem; font-weight: 500; }
.site-nav a:hover { color: var(--brand-primary); text-decoration: none; }
.site-nav .cta-editor {
  background: var(--brand-primary);
  color: #2b312c !important;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.15s, transform 0.05s;
}
.site-nav .cta-editor:hover { background: var(--brand-primary-dark); }
.site-nav .cta-editor:active { transform: translateY(1px); }

/* Footer - the canonical 4-column footer from the landing is included via
   _shared/footer.html and inherits the landing's main.css. These rules are
   only the legacy single-line footer fallback. */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  margin-top: var(--space-2xl);
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Conversion CTA block - was a flat blue gradient; now a brand-green tinted
   glass card so it reads as MiN8T-branded but doesn't shout over the page. */
.conversion-cta {
  background: linear-gradient(135deg, rgba(40, 239, 145, 0.12), rgba(40, 239, 145, 0.04));
  border: 1px solid rgba(40, 239, 145, 0.3);
  color: var(--text-primary);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  text-align: center;
  margin: var(--space-2xl) 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.conversion-cta h2 { color: var(--text-primary); margin-top: 0; }
.conversion-cta p { color: var(--text-secondary); }
.conversion-cta .btn {
  background: var(--brand-primary);
  color: #2b312c;
  font-weight: 700;
  padding: var(--space-md) var(--space-xl);
  margin-top: var(--space-md);
}
.conversion-cta .btn:hover {
  background: var(--brand-primary-dark);
}

/* Related-tools grid - glass cards instead of white cards */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.related-tools .tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: rgba(43, 49, 44, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s, transform 0.05s;
}
.related-tools .tool-card:hover {
  border-color: rgba(40, 239, 145, 0.4);
  text-decoration: none;
  transform: translateY(-2px);
}
.related-tools .tool-card h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
  color: var(--text-primary);
}
.related-tools .tool-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* FAQ */
.faq {
  margin: var(--space-lg) 0;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--brand-primary); }
.faq details[open] summary {
  color: var(--brand-primary);
  margin-bottom: var(--space-sm);
}
.faq details > *:not(summary) { color: var(--text-secondary); }

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  main { padding: var(--space-lg) var(--space-md); }
}

/* ---------------------------------------------------------------
   Form inputs inside the footer's light-bg cards revert to a light
   styling. The global input rule above sets dark glass bg + white
   text, which would render as white-on-white inside the .bg-white
   newsletter card.
   --------------------------------------------------------------- */
.bg-white input,
.bg-white textarea,
.bg-white select,
.bg-light-gray input,
.bg-light-gray textarea,
.bg-light-gray select {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ddd;
}
.bg-white input::placeholder,
.bg-light-gray input::placeholder {
  color: #999;
}
