/*
 * Scalable Crawling — Shared Design System
 * Based on DESIGN/DESIGN.md
 * Include this in all customer-facing and admin pages.
 */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Primary Brand */
  --primary-dark: #001d3d;
  --midnight: #000814;
  --deep-ocean: #031427;
  --accent-yellow: #ffc300;
  --accent-yellow-light: #ffdb66;

  /* Supporting */
  --neutral-gray: #e6e6e6;
  --white: #ffffff;
  --border: #d1d5db;
  --surface-shadow: #f8f9fa;

  /* Text */
  --text-primary: #001d3d;
  --text-secondary: #031427;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;

  /* Semantic */
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --error-border: #fca5a5;
  --success-bg: #f0fdf4;
  --success-text: #166534;
  --success-border: #86efac;
  --info-bg: #eff6ff;
  --info-text: #1e40af;

  /* Shadows */
  --shadow-soft: 0 4px 20px rgba(0, 29, 61, 0.08);
  --shadow-medium: 0 8px 32px rgba(0, 29, 61, 0.12);
  --shadow-focus: 0 0 0 4px rgba(255, 195, 0, 0.15);

  /* Typography */
  --font-display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Code", Monaco, Consolas, monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-pill: 999px;

  /* Container */
  --container-max: 1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--white);
  min-height: 100vh;
}
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }

/* ── Typography ── */
.font-display { font-family: var(--font-display); }

.text-hero {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.text-section {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.text-heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-body-lg {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-small {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.text-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-yellow);
}

.text-muted { color: var(--text-muted); }

/* ── Layout ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-7) var(--space-5);
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--midnight);
  border-bottom: 2px solid var(--accent-yellow);
}

.nav-brand {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.18s ease;
}

.nav-links a:hover { color: var(--accent-yellow); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent-yellow);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(255, 195, 0, 0.24);
}

.btn-primary:hover {
  background: var(--accent-yellow-light);
  box-shadow: 0 6px 20px rgba(255, 195, 0, 0.32);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  box-shadow: inset 0 0 0 2px var(--primary-dark);
}

.btn-secondary:hover {
  background: rgba(0, 29, 61, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
}

.btn-danger {
  background: #dc2626;
  color: var(--white);
}

.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--neutral-gray);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.input {
  width: 100%;
  font: inherit;
  color: var(--text-primary);
  background: var(--white);
  border: 1px solid var(--neutral-gray);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.input:focus {
  box-shadow: var(--shadow-focus);
  border-color: var(--accent-yellow);
}

.form-group input::placeholder,
.input::placeholder { color: var(--text-disabled); }

/* ── Alerts / Messages ── */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 14px;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid #bfdbfe;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  background: rgba(255, 195, 0, 0.1);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Status badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--white);
  font-weight: 600;
  font-size: 13px;
}

.status-active { background: #16a34a; }
.status-grace { background: #ca8a04; }
.status-cancelled { background: #dc2626; }
.status-new { background: var(--text-muted); }
.status-provisioning { background: #ea580c; }
.status-live { background: #16a34a; }
.status-suspended { background: #dc2626; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--neutral-gray);
  margin: var(--space-5) 0;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--neutral-gray);
  padding: var(--space-5);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ── Auth page layout ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(255, 195, 0, 0.08), transparent 24%),
    radial-gradient(circle at top left, rgba(0, 29, 61, 0.06), transparent 18%),
    var(--white);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--neutral-gray);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-medium);
}

.auth-card-wide {
  max-width: 500px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-5);
}

.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: var(--space-1);
}

.auth-links {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 14px;
}

.auth-links a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover { text-decoration: underline; }

/* ── Dashboard layout ── */
.dashboard-page {
  min-height: 100vh;
  background: var(--surface-shadow);
}

.dashboard-header {
  background: var(--midnight);
  color: var(--white);
  padding: var(--space-5);
  border-bottom: 2px solid var(--accent-yellow);
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.dashboard-header p {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: var(--space-1);
}

.dashboard-nav {
  background: var(--white);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--neutral-gray);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dashboard-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.18s ease;
}

.dashboard-nav a:hover { color: var(--accent-yellow); }

.dashboard-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-5);
}

/* ── Plan details grid ── */
.plan-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.plan-details p {
  padding: var(--space-3);
  background: var(--surface-shadow);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.plan-details strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Handover details ── */
.handover-box {
  background: #f0f4ff;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-top: var(--space-4);
}

.handover-box h3 {
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.handover-box pre {
  background: var(--white);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Pricing cards (used on index.php, dashboard, etc.) ── */
.pricing-card {
  background: var(--white);
  border: 1px solid var(--neutral-gray);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}
.pricing-card.featured {
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 4px 20px rgba(255, 195, 0, 0.15);
}
.pricing-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}
.pricing-price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin: var(--space-4) 0 var(--space-1);
}
.pricing-cadence {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: var(--space-5);
}
.pricing-savings {
  font-size: 14px;
  font-weight: 600;
  color: #166534;
  margin-bottom: var(--space-3);
}
.pricing-specs {
  text-align: left;
  margin: var(--space-5) 0;
  padding: 0;
  list-style: none;
}
.pricing-specs li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--neutral-gray);
  font-size: 14px;
}
.pricing-specs li:last-child {
  border-bottom: none;
}
.pricing-specs .spec-label {
  color: var(--text-secondary);
}
.pricing-specs .spec-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .section { padding: var(--space-5) var(--space-4); }
  .auth-card { padding: var(--space-5); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .plan-details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .plan-details { grid-template-columns: 1fr; }
  .dashboard-nav { gap: var(--space-3); }
}
