/*
 * File: app-base.css
 * Description: Shared valueSTK application styles.
 * Product-specific styles load after this file.
 */

/* ==========================================================================
   1. RESET (Andy Bell's Modern Reset)
========================================================================== */

/* 1.1 Box sizing rules across all elements */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 1.2 Prevent mobile browser font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* 1.3. Remove default margin for micro-level layout control */
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd {
  margin-block-end: 0;
}

/* 1.4. Remove list styles on lists used explicitly as layout roles */
ul[role='list'], ol[role='list'] {
  list-style: none;
}

/* 1.5. Core body layout & line-height defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* 1.6. Tighter line heights for headings and buttons */
h1, h2, h3, h4, button, input, label {
  line-height: 1.1;
}

/* 1.7. Balance heading text wrapping automatically */
h1, h2, h3, h4 {
  text-wrap: balance;
}

/* 1.8. Unstyled links inherit color naturally */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* 1.9. Make images & media responsive */
img, picture {
  max-width: 100%;
  height:auto;
  display: block;
}

/* 1.10 Form controls inherit parent typography */
input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* 1.11. Ensure empty textareas aren't microscopic on mobile touch */
textarea:not([rows]) {
  min-height: 10em;
}

/* 1.12 Add comfortable scroll margin when anchor targeting (#section) */
:target {
  scroll-margin-block: 5ex;
}

/* ==========================================================================
   2. DESIGN TOKENS (Variables used across ALL pages)
========================================================================== */

:root {
  /* Typography */
  --font-main: 'Lato', system-ui, -apple-system, sans-serif;
  --font-heading: 'Montserrat', system-ui, -apple-system, sans-serif;

  /* layout and spacing */
  --space-gutter: clamp(1rem, 4vw, 2.5rem);

  /* valueSTK Brand Palette */
  --brand-off-white: #F9F7F4; /* Warm off-white / light canvas */
  --brand-off-black: #3C3C3C; /* Soft off-black / dark canvas */
  --brand-primary:   #4E769E; /* Primary brand color / Slate Blue */
  --brand-secondary: #D7D1D5; /* Secondary brand color / Soft Greige */
  --brand-accent:    #B5D8CC; /* Accent / CTA color / Sea Foam */
  --brand-accent2:   #CE9DA9; /* Second Accent / CTA color / Dusty Pink*/
 
  /* UI Structural Layers derived from your palette */
  --brand-surface:   #F0EBEF; /* A slightly softer tint of your greige for distinct card depth */
  --brand-border:    #D7D1D5; /* Base greige acts as the perfect structural border */

  /* Light Mode Functional Roles */
  --bg-page:      var(--brand-off-white);
  --bg-card:      #FFFFFF;
  --bg-nested-card: #FCFCFC;
  --text-title: var(--brand-primary);
  --text-heading: var(--brand-primary);
  --text-body:    var(--brand-off-black);
  --brand-cta:    var(--brand-accent);
  --border-color: var(--brand-surface);

  --color-link: var(--brand-primary); 
  --color-link-hover: var(--brand-off-black); 

  --feature-bg: var(--brand-primary);
  --feature-heading: var(--brand-primary);
  --feature-text: var(--brand-off-white);

}

/* Dark Mode Role Flip */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page:      var(--brand-off-black);
    --bg-card:      #1E2328; /* Slightly lighter off-black for card depth */
    --bg-nested-card: #2D343B;
    --text-title: var(--brand-accent);
    --text-heading: var(--brand-off-white);
    --text-body:    var(--brand-surface); /* Softer light color for reading comfort */
    --brand-cta:    var(--brand-secondary); /* Accent swap for dark contrast */
    --brand-border: #2D343B;

    --color-link: var(--brand-accent); 
    --color-link-hover: var(--brand-off-white); 

    --feature-bg: var(--brand-accent);
    --feature-heading: var(--brand-accent);
    --feature-text: var(--brand-off-black);
  }
}

/* ==========================================================================
   3. Base Elements
========================================================================== */

body {
  font-family: var(--font-main);
  font-size: 1.125rem;  /*18px if 16px is default */
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,h2,h3 {
    margin-top: 0;
    color: var(--text-heading);
    font-family: var(--font-heading);
    font-weight: 500;
}

p{
    margin-bottom: 1rem;
}

a:not(.logo-link):not(.btn) {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:not(.logo-link):not(.btn):hover {
  color: var(--color-link-hover);
}

/* ==========================================================================
   4. LAYOUT PRIMITIVES
========================================================================== */

.site-container {
  width: 100%;
  max-width: 80rem; /* ~1280px max width for a wider modern canvas */
  margin: 0 auto;
  padding-inline: var(--space-gutter);
}

/* ==========================================================================
   5. SHARED COMPONENTS
      5.1 Header
      5.2 Footer
      5.3 Buttons
      5.4 Forms
========================================================================== */

/* 5.1 Site Header ======================================================= */

/* FLEXIBLE HEADER (Your exact logo + title setup) */
.header-container {
  max-width: 80rem;
  margin-inline: auto; /* <-- ADD THIS to center the container */
  padding-inline: var(--space-gutter); /* <-- OPTIONAL: prevents touching screen edges on mobile */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--brand-border);
}

/* Convert to side-by-side row on desktop */
@media (min-width: 48rem) {
  .header-container {
    flex-direction: row;
    justify-content: space-between;
  }
}

.logo-link {
  display: block;
  width: clamp(8rem, 15vw, 12rem); /* Your exact fluid logo sizing */
  text-decoration: none;
  line-height: 0;                   /* Prevents ghost space under image */
}

.site-logo {
  width: 100%;
  height: auto;
  display:block;
}

/* 5.2 Site Footer ======================================================= */

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem;
    text-align: center;
}

.footer-line {
    display: block;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.6;
   }

/* 5.3 Buttons =========================================================== */

/* Base Button (Default Size: Medium) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  
  /* Default Medium Size */
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  
  /* Smooth transitions for all state changes */
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

/* Accessibility: Focus state for keyboard navigation */
.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Tactile press effect for all buttons */
.btn:active {
  transform: translateY(1px);
}

/* Size Modifiers */
.btn-sm {
  padding: 0.375rem 0.75rem; /* ~6px 12px */
  font-size: 0.875rem;       /* 14px */
}

.btn-lg {
  padding: 0.875rem 1.75rem; /* ~14px 28px */
  font-size: 1.125rem;       /* 18px */
}


/* Color Variants with Hover States */

/* Primary Button */
.btn-primary {
  background-color: var(--feature-bg);
  color: var(--feature-text);
}

.btn-primary:hover {
  /* Subtle dim/brightening effect that works in both light & dark mode */
  filter: brightness(0.92);
  transform: translateY(-1px);
}

/* Secondary / Outline Button */
.btn-secondary {
  background-color: transparent;
  border-color: var(--brand-border);
  color: var(--text-heading);
}

.btn-secondary:hover {
  background-color: var(--brand-surface);
  border-color: var(--text-heading);
  transform: translateY(-1px);
}

/* Third / Brand Colours */
.btn-brand { 
  background-color: var(--brand-primary); 
  color: var(--brand-off-white);}

.btn-brand:hover {
  /* Subtle dim/brightening effect that works in both light & dark mode */
  filter: brightness(0.80);
  transform: translateY(-1px);
}

/* 5.4 Forms & Review Form Section                                         */

.form-section {
  width: 100%;
  padding-block: clamp(3.5rem, 6vw, 5.5rem);
  background-color: var(--bg-page); /* Off-white page canvas */
}

.form-header {
  max-width: 68rem; /* Wider desktop header span */
  margin: 0 auto 2.5rem auto;
  text-align: center;
}

.form-description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-body);
  margin-bottom: 0;
}

/* Form Card Container (Layer 2) */
.form-container {
  max-width: 54rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  background-color: transparent;
  border: 1px solid var(--brand-primary);
  border-radius: 0.75rem;
  box-shadow: none;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-off-black);
  margin-bottom: 0.5rem;
}

.form-group p {
    margin: 0.4rem 0 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .form-group label {
    color: var(--text-heading);
  }
}

/* Input Fields & Textarea Wells (Layer 3) */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  padding: 0.95rem 1.15rem;
  font-size: 1.05rem;
  color: var(--text-body);
  background-color: #F7F9FC;
  border: 1px solid var(--brand-border); /* Clear border outline */
  border-radius: 0.6rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Focused Active State: Lights up white on focus */
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  background-color: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(78, 118, 158, 0.15); /* Soft slate blue focus glow */
}

.form-group textarea {
  resize: vertical;
  min-height: 180px;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--brand-off-black);
  background-color: var(--brand-accent);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: filter 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 6px;
}

.btn-submit:hover {
  filter: brightness(0.93);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(0.2);
  transform: none;
  box-shadow: none;
}

.btn-submit:disabled:hover {
  filter: grayscale(0.2);
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   6. PAGE SECTIONS
      6.1 Hero
      6.2 Call to Action (CTA)
========================================================================== */

/* 6.1 Hero Section ====================================================== */

.site-hero {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  background: var(--bg-page);
}

/* Controlled Break: Desktop Only */
.desktop-only {
  display: none;
}

@media (min-width: 48rem) {
  .desktop-only {
    display: inline;
  }
}

.hero-category {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.15;
  color: var(--text-title);
  margin-bottom: 1.25rem;
}

.hero-subheading {
  font-size: 1.25rem;
  line-height: 1.35;
  color: var(--text-body);
  margin-bottom: 0.5rem; /* Tightened gap to description */
}

.hero-subheading strong {
  font-weight: 600;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-body);
  margin-bottom: 0;
}

.hero-btn {
  padding: 0.875rem 1.75rem;
  font-size: 1.125rem;
  border-radius: 6px;
}

.hero-media img {
  width: 100%;
  height: auto;
  display: block;
}

/* 6.2 Generic Split Grid Module (Responsive 2-Column Grid w Mobile Sandwich) */

.split-grid {
  display: grid;
  gap: 1.5rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  grid-template-areas:
    "intro"
    "media"
    "features"
    "action";
}

.split-intro    { grid-area: intro; }
.split-media    { grid-area: media; }
.split-features { grid-area: features; }
.split-action   { grid-area: action; }

@media (min-width: 48rem) {
  .split-grid {
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-rows: auto auto auto; /* Add this line: prevents grid rows from expanding vertically */
    grid-template-areas:
      "intro    media"
      "features media"
      "action   media";
    column-gap: clamp(2.5rem, 4vw, 4rem);
    align-items: start;
  }
  
  /* Remove default bottom paragraph margin on the last p inside intro */
  .split-intro p:last-child {
    margin-bottom: 0;
  }
}


/* Feature List & Icon Styling */
.cta-features {
  display: grid;
  gap: 1.25rem;
}

.feature-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.feature-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--feature-heading);
}

.feature-item p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--feature-bg);
  color: var(--feature-text);
  border-radius: 50%;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.cta-media img {
  border-radius: 0.75rem;
  object-fit: cover;
  width: 100%;
  max-height: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}


/* Loading indicator / spinner */
/* form submit, please wait spinner */
.loading[hidden] {
    display: none;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

