/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: #7dd3fc; text-decoration: none; transition: color 0.2s; }
a:hover { color: #bae6fd; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ===== Skip Link ===== */
.skip-link {
  position: absolute; top: -100px; left: 0; background: #1e293b; color: #e2e8f0; padding: 0.5rem 1rem; z-index: 1000;
}
.skip-link:focus { top: 0; }

/* ===== Header ===== */
.site-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.25rem; color: #f1f5f9;
  text-decoration: none;
}
.logo:hover { color: #7dd3fc; }
.nav-list { display: flex; list-style: none; gap: 1.5rem; }
.nav-list a { font-weight: 500; font-size: 0.95rem; color: #94a3b8; }
.nav-list a.active, .nav-list a:hover { color: #7dd3fc; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 3rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid #334155;
}
.hero h1 { font-size: 2.5rem; font-weight: 800; color: #f8fafc; letter-spacing: -0.02em; }
.hero-lead { max-width: 720px; margin: 1rem auto 0; color: #94a3b8; font-size: 1.1rem; }

/* ===== Tool Section ===== */
.tool-section { padding: 2.5rem 0 3rem; flex: 1; }
.tool-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 12px;
  padding: 1.75rem; margin-bottom: 2rem;
}
.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: #cbd5e1; font-size: 0.9rem; }
.regex-input-wrapper {
  display: flex; align-items: center; gap: 0.25rem;
  background: #0f172a; border: 1px solid #475569; border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.regex-delimiter { color: #7dd3fc; font-weight: 700; font-size: 1.3rem; user-select: none; }
#regex-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #e2e8f0; font-family: 'Courier New', Courier, monospace; font-size: 1rem;
  padding: 0.25rem 0;
}
#regex-input::placeholder { color: #64748b; }
.flags-wrapper { display: flex; gap: 0.75rem; margin-left: 0.5rem; }
.flag-label { font-size: 0.85rem; color: #94a3b8; cursor: pointer; display: flex; align-items: center; gap: 0.2rem; }
.flag-label input { accent-color: #7dd3fc; }

.button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-primary, .btn-secondary, .btn-outline {
  padding: 0.6rem 1.4rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none; transition: background 0.2s, opacity 0.2s;
}
.btn-primary { background: #7dd3fc; color: #0f172a; }
.btn-primary:hover { background: #bae6fd; }
.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-secondary:hover { background: #475569; }
.btn-outline { background: transparent; border: 1px solid #475569; color: #cbd5e1; }
.btn-outline:hover:not(:disabled) { border-color: #7dd3fc; color: #7dd3fc; }
.btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }

.error-message { color: #fca5a5; font-size: 0.9rem; margin-top: 0.75rem; min-height: 1.2rem; }

/* ===== Results Panel ===== */
.results-panel { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 1.75rem; }
.results-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.results-header h2 { font-size: 1.3rem; font-weight: 700; color: #f1f5f9; }
.results-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.placeholder-message { text-align: center; padding: 2.5rem 1rem; color: #64748b; }
.placeholder-message svg { margin: 0 auto 1rem; }

.test-case-card {
  background: #0f172a; border: 1px solid #334155; border-radius: 8px;
  padding: 1rem 1.25rem; display: grid;
  grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem;
}
.test-string {
  font-family: 'Courier New', Courier, monospace; font-size: 0.95rem;
  color: #e2e8f0; word-break: break-all;
}
.test-reason { font-size: 0.8rem; color: #94a3b8; grid-column: 1 / -1; }
.match-badge {
  padding: 0.25rem 0.75rem; border-radius: 20px; font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.match-badge.match { background: #14532d; color: #86efac; }
.match-badge.no-match { background: #7f1d1d; color: #fca5a5; }

/* ===== Features ===== */
.features-section { padding: 3rem 0; background: #0f172a; border-top: 1px solid #1e293b; }
.features-section h2 { font-size: 1.8rem; font-weight: 700; text-align: center; margin-bottom: 2rem; color: #f1f5f9; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.feature-card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 1.5rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: #7dd3fc; }
.feature-card p { font-size: 0.95rem; color: #94a3b8; }

/* ===== How It Works ===== */
.how-section { padding: 3rem 0; border-top: 1px solid #1e293b; }
.how-section h2 { font-size: 1.8rem; font-weight: 700; text-align: center; margin-bottom: 2rem; color: #f1f5f9; }
.steps-list { max-width: 700px; margin: 0 auto; padding-left: 1.5rem; color: #cbd5e1; }
.steps-list li { margin-bottom: 1rem; font-size: 1rem; line-height: 1.7; }
.steps-list li strong { color: #f1f5f9; }

/* ===== Footer ===== */
.site-footer { background: #1e293b; border-top: 1px solid #334155; padding: 1.5rem 0; margin-top: auto; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-inner p { color: #64748b; font-size: 0.85rem; }
.footer-nav { display: flex; list-style: none; gap: 1.5rem; }
.footer-nav a { color: #94a3b8; font-size: 0.85rem; }
.footer-nav a:hover { color: #7dd3fc; }

/* ===== About / Legal Pages ===== */
.page-content { padding: 3rem 0; flex: 1; }
.page-content h1 { font-size: 2rem; font-weight: 800; margin-bottom: 1.5rem; color: #f8fafc; }
.page-content .prose { max-width: 720px; color: #cbd5e1; line-height: 1.8; }
.page-content .prose p { margin-bottom: 1rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-lead { font-size: 1rem; }
  .regex-input-wrapper { flex-wrap: wrap; gap: 0.5rem; }
  .flags-wrapper { margin-left: 0; width: 100%; justify-content: flex-start; }
  .test-case-card { grid-template-columns: 1fr auto; }
  .test-reason { grid-column: 1 / -1; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .header-inner { height: auto; padding: 0.75rem 0; flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
  .button-row { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
  .results-header { flex-direction: column; align-items: flex-start; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
