/* AI Receptionist — modern dark theme */
:root {
  --bg: #0c0f17;
  --bg-card: #131822;
  --bg-input: #1a2030;
  --border: rgba(148, 163, 184, 0.12);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --success: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(129, 140, 248, 0.15), transparent), radial-gradient(ellipse 60% 40% at 100% 100%, rgba(99, 102, 241, 0.08), transparent);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

h2, .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.card-desc, .muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #a5b4fc;
}

/* Nav */
.nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-title {
  margin-right: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-view-as {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-view-as-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: none;
  font-weight: 500;
}

.view-as-select {
  width: auto;
  min-width: 180px;
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #252b3d;
  border-color: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.card-section {
  padding: 1.5rem 1.75rem;
}

.card-section .card-title {
  margin-bottom: 0.25rem;
}

/* Forms */
label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 0.75rem;
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.25);
}

.form-inline {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .form-inline { grid-template-columns: 1fr; }
}

.form-grid {
  margin-top: 1rem;
}

.form-grid label { margin-bottom: 0.35rem; }
.form-grid input, .form-grid select { margin-bottom: 0.75rem; }

.form-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.msg {
  font-size: 0.875rem;
  margin: 0.5rem 0 0 0;
}

/* Tables */
.table, table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th, .table td, th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th, th {
  background: rgba(26, 32, 48, 0.8);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table tbody tr:hover, tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-trial { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.badge-active { background: rgba(52, 211, 153, 0.2); color: var(--success); }
.badge-paused { background: rgba(148, 163, 184, 0.2); color: var(--text-muted); }
.badge-cancelled { background: rgba(248, 113, 113, 0.2); color: var(--danger); }
.badge-expired { background: rgba(248, 113, 113, 0.25); color: #fca5a5; margin-left: 0.25rem; }

.error { color: var(--danger); font-size: 0.875rem; margin-top: 0.5rem; }
.hidden { display: none !important; }

/* Products landing (parent hub) */
.products-landing {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.products-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.products-headline {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem 0;
}

.products-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.products-category {
  margin-bottom: 2.5rem;
}

.products-category-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.product-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.product-card:hover {
  border-color: rgba(129, 140, 248, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.product-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.product-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.product-card-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.products-footer {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.85rem;
}

.products-footer code {
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.products-nav-inline {
  text-align: center;
  margin: -0.5rem 0 1.5rem 0;
}

.products-nav-inline .link-back {
  font-size: 0.9rem;
}

.link-back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-back:hover {
  color: var(--accent);
}

/* Login / signup centering */
.card[style*="max-width: 360px"] {
  margin-left: auto;
  margin-right: auto;
}
