/* ============================================================
   POTENTIOS — Design System
   Primary: violet-600 #7c3aed
   Neutrals: stone
   Font: Inter
   ============================================================ */

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

:root {
  --violet-50:  #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-300: #c4b5fd;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-800: #5b21b6;

  --stone-50:  #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  --emerald-50:  #ecfdf5;
  --emerald-200: #a7f3d0;
  --emerald-700: #047857;

  --amber-50:  #fffbeb;
  --amber-200: #fde68a;
  --amber-700: #b45309;

  --red-50:  #fef2f2;
  --red-200: #fecaca;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --blue-50:  #eff6ff;
  --blue-200: #bfdbfe;
  --blue-700: #1d4ed8;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

html, body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--stone-800);
  background: var(--stone-50);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-body {
  min-height: 100vh;
  background: #f0eeff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.logo-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--stone-900);
  letter-spacing: -0.02em;
}

/* Card */
.login-card {
  width: 100%;
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--stone-900);
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--stone-500);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.login-hint {
  font-size: 0.82rem;
  color: var(--stone-400);
  text-align: center;
  line-height: 1.6;
  margin-top: 1rem;
}

.login-footer {
  font-size: 0.8rem;
  color: var(--stone-400);
  text-align: center;
}

.login-footer a {
  color: var(--violet-600);
  text-decoration: underline;
}

/* Form */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-700);
  margin-bottom: 0.5rem;
}

.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--stone-400);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--stone-900);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.form-input::placeholder { color: var(--stone-400); }

.form-error {
  font-size: 0.82rem;
  color: var(--red-600);
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: var(--red-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--red-200);
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: white;
  color: var(--stone-700);
  border: 1.5px solid var(--stone-200);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover { border-color: var(--stone-300); background: var(--stone-50); }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--violet-600);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-ghost:hover { background: var(--violet-50); }

.btn-full { width: 100%; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--stone-500);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}

.btn-back:hover { color: var(--stone-800); }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--stone-400);
  font-size: 0.8rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stone-200);
}

/* Magic link icon */
.magic-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--violet-50);
  color: var(--violet-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

/* Forgot link */
.forgot-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--violet-600);
  text-decoration: none;
}

.forgot-link:hover { text-decoration: underline; }

/* Utility */
.hidden { display: none !important; }

/* ============================================================
   APP SHELL (post-login)
   ============================================================ */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Nav */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stone-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--stone-900);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main content */
.main-content {
  margin-top: 60px;
  padding: 2rem;
  flex: 1;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stone-200);
  padding: 1.25rem;
}

.card:hover {
  border-color: var(--violet-300);
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid;
}

.badge-active   { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-200); }
.badge-paused   { background: var(--amber-50);   color: var(--amber-700);   border-color: var(--amber-200); }
.badge-inactive { background: var(--stone-100);  color: var(--stone-500);   border-color: var(--stone-200); }
.badge-new      { background: var(--blue-50);    color: var(--blue-700);    border-color: var(--blue-200); }
.badge-violet   { background: var(--violet-50);  color: var(--violet-600);  border-color: var(--violet-200); }
