/* =========================================================
   main.css — CSS custom properties + global base styles
   ========================================================= */

:root {
  --color-primary: #1a56db;
  --color-primary-hover: #1447c0;
  --color-primary-light: #e8f0fe;
  --color-surface: #ffffff;
  --color-surface-alt: #f3f4f6;
  --color-surface-hover: #f9fafb;
  --color-border: #e5e7eb;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-text-light: #9ca3af;
  --color-success: #059669;
  --color-success-bg: #d1fae5;
  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-critical: #7c3aed;
  --color-critical-bg: #ede9fe;
  --color-info: #0284c7;
  --color-info-bg: #e0f2fe;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.10), 0 4px 6px rgba(0,0,0,0.05);
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --transition: 150ms ease;
}

[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-light: #1e3a5f;
  --color-surface: #1f2937;
  --color-surface-alt: #111827;
  --color-surface-hover: #374151;
  --color-border: #374151;
  --color-text: #f9fafb;
  --color-text-muted: #9ca3af;
  --color-text-light: #6b7280;
  --color-success: #34d399;
  --color-success-bg: #064e3b;
  --color-warning: #fbbf24;
  --color-warning-bg: #451a03;
  --color-danger: #f87171;
  --color-danger-bg: #450a0a;
  --color-critical: #a78bfa;
  --color-critical-bg: #2e1065;
  --color-info: #38bdf8;
  --color-info-bg: #0c4a6e;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 4px 6px rgba(0,0,0,0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface-alt);
  line-height: 1.5;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--color-text-muted); line-height: 1.6; }

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

/* ── App Header ── */
#app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  border-bottom-color: transparent;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--color-border), 0 2px 8px rgba(0,0,0,0.06);
  background-image: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface) 100%);
}
#app-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, #7c3aed 50%, var(--color-primary) 100%);
  background-size: 200% 100%;
  animation: headerGradient 6s linear infinite;
}
@keyframes headerGradient {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.4);
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
  -webkit-text-fill-color: var(--color-text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#org-indicator {
  font-size: 0.8rem;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
  border-radius: 20px;
  padding: 4px 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* ── Main Layout ── */
#app-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── Wizard Nav Buttons ── */
#wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.nav-left, .nav-right {
  display: flex;
  gap: 12px;
}

/* ── 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;
}

.text-muted { color: var(--color-text-muted); font-size: 0.875rem; }
.text-small { font-size: 0.8125rem; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* ── Resume Banner ── */
#resume-banner {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#resume-banner p {
  color: var(--color-text);
  margin: 0;
  font-size: 0.9rem;
}

.resume-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  #app-body { padding: 16px 12px; }
  #app-header { padding: 0 16px; }
  .header-subtitle { display: none; }
  #wizard-nav { flex-direction: column-reverse; gap: 12px; }
  .nav-left, .nav-right { width: 100%; justify-content: center; }
}
