/* ============================================
   AgentAbout.Me — Shared Styles
   Used by: index.html, join.html, join-confirmed.html
   Contains: design tokens, reset, navigation, footer,
             reduced motion, focus rings, responsive base.
   ============================================ */

/* ============================================
   Design Tokens
   Light theme: Stripe — warm, professional, high-trust
   Dark theme:  Vercel — minimal, developer-grade black
   Usage: all colors, spacing, radius must reference tokens.
   Never hard-code raw hex or px values in component styles.
   ============================================ */

:root,
[data-theme="light"] {
  /* Brand */
  --color-primary:        #635BFF;
  --color-primary-hover:  #5851DB;
  --color-primary-light:  #F0EBFF;
  --color-accent:         #FF7A5C;

  /* Surfaces */
  --color-bg:               #FFFFFF;
  --color-nav-bg:           #FFFFFF;
  --color-surface:          #F6F9FC;
  --color-surface-elevated: #FFFFFF;
  --color-border:           #E3E8EE;
  --color-border-subtle:    #DFE3E8;

  /* Typography */
  --color-text-primary:   #1A1F36;
  --color-text-secondary: #697386;
  --color-text-muted:     #6B7280;

  /* Semantics */
  --color-success:    #0CAF60;
  --color-success-bg: #EDFBF3;
  --color-error:      #E53E3E;
  --color-error-bg:   #FEF2F2;
  --color-error-border:#FECACA;

  /* Shadows */
  --shadow-card:       0 2px 6px rgba(50,50,93,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 4px 12px rgba(50,50,93,0.12), 0 2px 6px rgba(0,0,0,0.08);

  /* CTA button */
  --cta-bg:            #635BFF;
  --cta-text-color:    #FFFFFF;
  --cta-hover-bg:      #5851DB;
  --cta-shadow:        0 4px 14px rgba(99,91,255,0.25);
  --cta-hover-shadow:  0 6px 20px rgba(99,91,255,0.35);
  --cta-hover-translate: -1px;

  /* Nav control buttons */
  --control-hover-border: #635BFF;
  --control-hover-color:  #635BFF;
  --control-hover-bg:     #F0EBFF;

  /* Form */
  --hint-bg:          #F6F9FC;
  --hint-text:        #697386;
  --input-focus-ring: rgba(99,91,255,0.3);

  /* Separators */
  --nav-border:       #E3E8EE;
  --separator-color:  #E3E8EE;

  /* Typography scale */
  --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --border-radius:    8px;
  --border-radius-lg: 12px;
  --nav-height:       64px;
  --container-width:  1200px;
  --nav-padding:      120px;
}

[data-theme="dark"] {
  /* Brand */
  --color-primary:        #0070F3;
  --color-primary-hover:  #0060DF;
  --color-primary-light:  rgba(0,112,243,0.1);
  --color-accent:         #0070F3;

  /* Surfaces */
  --color-bg:               #000000;
  --color-nav-bg:           #000000;
  --color-surface:          #111111;
  --color-surface-elevated: #1A1A1A;
  --color-border:           #333333;
  --color-border-subtle:    #2A2A2A;

  /* Typography */
  --color-text-primary:   #FFFFFF;
  --color-text-secondary: #999999;
  --color-text-muted:     #787878;

  /* Semantics */
  --color-success:    #26D367;
  --color-success-bg: rgba(38,211,103,0.1);
  --color-error:      #FCA5A5;
  --color-error-bg:   rgba(239,68,68,0.1);
  --color-error-border:rgba(239,68,68,0.2);

  /* Shadows */
  --shadow-card:       0 0 0 1px rgba(255,255,255,0.08);
  --shadow-card-hover: 0 0 0 1px rgba(255,255,255,0.15);

  /* CTA button — inverted in dark mode */
  --cta-bg:            #FFFFFF;
  --cta-text-color:    #000000;
  --cta-hover-bg:      #EAEAEA;
  --cta-shadow:        none;
  --cta-hover-shadow:  none;
  --cta-hover-translate: -1px;

  /* Nav control buttons */
  --control-hover-border: #FFFFFF;
  --control-hover-color:  #FFFFFF;
  --control-hover-bg:     transparent;

  /* Form */
  --hint-bg:          #111111;
  --hint-text:        #999999;
  --input-focus-ring: rgba(0,112,243,0.3);

  /* Separators */
  --nav-border:       #2A2A2A;
  --separator-color:  #333333;
}


/* ============================================
   Base Reset
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}


/* ============================================
   Navigation — shared layout & control buttons
   Page-specific left-side content (.nav-logo,
   .nav-back, .nav-left-spacer) is defined per page.
   ============================================ */

.nav {
  width: 100%;
  height: var(--nav-height);
  background-color: var(--color-nav-bg);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--nav-padding);
  position: sticky;
  top: 0;
  z-index: 200;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Shared base for theme-toggle and lang-toggle */
.nav-control-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  color: var(--color-text-secondary);
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  padding: 0;
}

.nav-control-btn:hover {
  border-color: var(--control-hover-border);
  color: var(--control-hover-color);
  background: var(--control-hover-bg);
}

.nav-control-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.lang-toggle {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* Show/hide moon & sun based on current theme */
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: none;  }
[data-theme="dark"]  .icon-moon { display: none;  }
[data-theme="dark"]  .icon-sun  { display: block; }


/* ============================================
   Footer
   ============================================ */

.footer-separator {
  width: 100%;
  height: 1px;
  background-color: var(--separator-color);
  transition: background-color 0.3s ease;
}

.footer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 40px var(--nav-padding);
}

.footer-copyright {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}


/* ============================================
   Accessibility — Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* Disable motion-related transitions only — preserve color/opacity for readability */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-property: transform, left, right, top, bottom !important;
  }

  .cta-button:hover,
  .submit-btn:hover,
  .feature-card:hover,
  .feedback-btn:hover {
    transform: none !important;
  }
}


/* ============================================
   Focus Rings — unified across interactive controls
   ============================================ */

.cta-button:focus-visible,
.submit-btn:focus-visible,
.nav-control-btn:focus-visible,
.feature-card:focus-visible,
.feedback-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}


/* ============================================
   Responsive — shared breakpoints
   ============================================ */

@media (max-width: 1024px) {
  :root { --nav-padding: 48px; }
}

@media (max-width: 640px) {
  :root { --nav-padding: 24px; }
}
