/* ==========================================================================
   Tracking Match shared theme — clean, cool-neutral SaaS design system.
   Linked from every page BEFORE the page's own styles.css, which then
   layers on page-specific layout using these variables/classes.
   ========================================================================== */

:root {
  /* Brand accent — indigo/blue, replaces the old coral/orange */
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-dark: #4338ca;
  --accent-tint: #eef2ff;
  --accent-tint-strong: #e0e4ff;

  /* Semantic colors (kept separate from brand accent) */
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;

  /* Neutrals / surfaces */
  --bg: #f7f8fb;
  --bg-alt: #eef0f4;
  --surface: #ffffff;
  --surface-raised: #ffffff;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #566073;
  --text-muted: #94a1b2;
  --text-on-accent: #ffffff;

  /* Borders / shadows */
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-accent: 0 8px 20px rgba(79, 70, 229, 0.24);

  /* Shape — sharper rounded-rects, not pills */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Motion */
  --transition: 0.15s ease;

  /* Type */
  --font-heading: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.theme-reset,
.theme-reset * {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================== Buttons ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #1ebe57;
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: 15px 32px;
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================== Cards ============================== */

.card,
.theme-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ============================== Forms ============================== */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input,
.control-select,
select,
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.control-select:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}

.form-input.monospace {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

/* ============================== Badges ============================== */

.badge,
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* ============================== Modals ============================== */

.payment-modal,
.auth-modal,
.welcome-modal,
.device-conflict-modal,
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.payment-modal.show,
.auth-modal.show,
.welcome-modal.show,
.device-conflict-modal.show,
.modal.show {
  display: flex;
}

.payment-modal-content,
.auth-modal-content,
.welcome-modal-content,
.device-conflict-modal-content,
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-alt);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--accent-tint);
  color: var(--accent-dark);
}

/* ============================== Utility ============================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.warning-box {
  background: var(--warning-light);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: #92640a;
}

.verification-message {
  font-size: 13px;
  margin-top: 10px;
}

.verification-message.success { color: var(--success); }
.verification-message.error { color: var(--danger); }
