/* ===========================================================
   TestApp Design System
   Palette: indigo primary + teal accent, soft cool-white surface.
   Type: Poppins for display/headings, Inter for body/UI text.
   =========================================================== */

:root {
  --color-primary: #4F46E5;
  --color-primary-dark: #3F37C9;
  --color-primary-light: #EEF0FF;
  --color-accent: #14B8A6;
  --color-accent-light: #E6FBF8;
  --color-warn: #F59E0B;
  --color-danger: #E5484D;
  --color-success: #16A34A;

  --color-bg: #F6F7FB;
  --color-surface: #FFFFFF;
  --color-text: #1B1E2B;
  --color-text-muted: #6B7280;
  --color-border: #E7E9F3;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-soft: 0 2px 10px rgba(30, 34, 60, 0.05), 0 10px 24px -12px rgba(30, 34, 60, 0.10);
  --shadow-hover: 0 4px 16px rgba(30, 34, 60, 0.08), 0 16px 32px -14px rgba(30, 34, 60, 0.16);

  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { -webkit-font-smoothing: antialiased; }

html, body {
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
}

h1, h2, h3, h4, h5, h6, .display-font {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { text-decoration: none; }

.text-muted-soft { color: var(--color-text-muted) !important; }
.text-primary-brand { color: var(--color-primary) !important; }
.bg-primary-brand { background: var(--color-primary) !important; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  font-size: 0.92rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-brand {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.btn-brand:hover, .btn-brand:focus {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, 0.55);
}
.btn-outline-brand {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn-outline-brand:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.btn-accent:hover { filter: brightness(0.94); color: #fff; }

.btn-sm-pill {
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
}

/* ---------- Cards / Surfaces ---------- */
.surface-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.surface-card.hoverable {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.surface-card.hoverable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.stat-card {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--color-border);
  padding: 0.62rem 0.9rem;
  font-size: 0.94rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}
.form-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

/* ---------- Auth pages ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-visual {
  background: radial-gradient(120% 120% at 15% 10%, #6C63FF 0%, var(--color-primary) 45%, var(--color-primary-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 80%, rgba(255,255,255,0.14) 0, transparent 45%),
                     radial-gradient(circle at 10% 90%, rgba(20,184,166,0.35) 0, transparent 40%);
}
.auth-visual .content { position: relative; z-index: 1; }
.auth-form-panel {
  background: var(--color-surface);
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---------- App shell (dashboard layout) ---------- */
.app-sidebar {
  width: 260px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  min-height: 100vh;
}
.app-sidebar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.92rem;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.sidebar-link.active { background: var(--color-primary); color: #fff; }
.sidebar-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  font-weight: 700;
  padding: 0.6rem 0.9rem 0.3rem;
}

.app-topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.85rem 1.5rem;
}

.app-main {
  background: var(--color-bg);
  min-height: 100vh;
}

.avatar-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.badge-status {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
}
.badge-status.active { background: #DCFCE7; color: #166534; }
.badge-status.pending { background: #FEF3C7; color: #92400E; }
.badge-status.suspended { background: #FEE2E2; color: #991B1B; }
.badge-status.draft { background: #F1F1F6; color: #52525B; }
.badge-status.published { background: #DCFCE7; color: #166534; }
.badge-status.rejected { background: #FEE2E2; color: #991B1B; }
.badge-status.disabled { background: #F1F1F6; color: #52525B; }

.step-pill {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.step-pill.done { background: var(--color-success); color: #fff; }

/* Mobile off-canvas sidebar */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1045;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-hover); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(15, 17, 30, 0.45);
    z-index: 1040; display: none;
  }
  .sidebar-backdrop.open { display: block; }
}

.focus-ring:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

/* ---------- Phase 2: app cards ---------- */
.app-icon-thumb {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-primary-light);
  flex-shrink: 0;
}
.app-icon-placeholder {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nav-pills-tabs .nav-link {
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.nav-pills-tabs .nav-link.active {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Phase 3: star rating ---------- */
.star-rating-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 0.15rem;
}
.star-rating-input input {
  display: none;
}
.star-rating-input label {
  font-size: 1.7rem;
  color: #E2E4EC;
  cursor: pointer;
  transition: color 0.1s ease;
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
  color: #F59E0B;
}
.star-rating-display {
  color: #F59E0B;
  letter-spacing: 1px;
}
.star-rating-display .star-empty {
  color: #E2E4EC;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
