/* ═══════════════════════════════════════════════════════════
   FEEDBACK SMS — IBCV Timișoara Design System
   Inspired by cardiologie.ro — Red/White Medical Theme
   ═══════════════════════════════════════════════════════════ */

/* ─── Fonts ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-void: #f5f5f5;
  --bg-deep: #ffffff;
  --bg-base: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-glass-hover: rgba(255, 255, 255, 1);

  /* Primary — IBCV Red */
  --red-700: #a01a28;
  --red-600: #CC2030;
  --red-500: #d93545;
  --red-400: #e25565;
  --red-glow: rgba(204, 32, 48, 0.12);

  /* Legacy aliases (so dashboard pages still work) */
  --teal-600: var(--red-600);
  --teal-500: var(--red-500);
  --teal-400: var(--red-600);
  --teal-glow: var(--red-glow);

  /* Accent — Amber Signal */
  --amber-500: #F59E0B;
  --amber-400: #D97706;
  --amber-glow: rgba(245, 158, 11, 0.10);

  /* Data — Blue */
  --cyan-500: #2563EB;
  --cyan-400: #3B82F6;
  --cyan-glow: rgba(37, 99, 235, 0.08);

  /* Semantic */
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --danger-glow: rgba(220, 38, 38, 0.08);

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);
  --border-active: rgba(204, 32, 48, 0.3);

  /* Typography */
  --font-heading: 'Bitter', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

a {
  color: var(--red-600);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--red-700);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* ─── Utility Classes ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

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

.text-teal {
  color: var(--red-600);
}

.text-amber {
  color: var(--amber-400);
}

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

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

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.gap-4 {
  gap: 2rem;
}

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all var(--duration-base) var(--ease-out);
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: var(--border-active);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

/* ─── Metric Card ────────────────────────────────────────── */
.metric {
  text-align: center;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.btn-primary {
  background: var(--red-600);
  color: white;
}

.btn-primary:hover {
  background: var(--red-700);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--red-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-base);
  border-color: var(--border-active);
}

.btn-amber {
  background: var(--amber-500);
  color: white;
}

.btn-amber:hover {
  background: var(--amber-400);
  color: white;
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
  background: var(--danger-glow);
}

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

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

/* ─── Form Elements ──────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.625rem 0.875rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ─── Table ──────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-base);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-base);
  color: var(--text-primary);
}

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.badge-warning {
  background: var(--amber-glow);
  color: var(--amber-400);
}

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

.badge-info {
  background: var(--cyan-glow);
  color: var(--cyan-400);
}

.badge-neutral {
  background: var(--bg-base);
  color: var(--text-muted);
}

/* ─── Staggered Entry Animation ──────────────────────────── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger {
  opacity: 0;
  animation: fadeSlideUp var(--duration-slow) var(--ease-out) forwards;
}

.stagger:nth-child(1) {
  animation-delay: 60ms;
}

.stagger:nth-child(2) {
  animation-delay: 120ms;
}

.stagger:nth-child(3) {
  animation-delay: 180ms;
}

.stagger:nth-child(4) {
  animation-delay: 240ms;
}

.stagger:nth-child(5) {
  animation-delay: 300ms;
}

.stagger:nth-child(6) {
  animation-delay: 360ms;
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 12px var(--red-glow);
  }

  50% {
    box-shadow: 0 0 28px var(--red-glow);
  }
}

/* ─── Dashboard Layout ───────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-brand {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.sidebar-brand h2 {
  font-size: 1rem;
  color: var(--red-600);
}

.sidebar-brand p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--red-glow);
  color: var(--red-600);
  font-weight: 600;
}

.nav-link .icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
}

.nav-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 1rem 0.75rem 0.35rem;
}

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  background: var(--bg-void);
  min-height: 100vh;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ─── Login ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, #f5f5f5 25%, transparent 25%) -50px 0,
    linear-gradient(225deg, #f5f5f5 25%, transparent 25%) -50px 0,
    linear-gradient(315deg, #f5f5f5 25%, transparent 25%),
    linear-gradient(45deg, #f5f5f5 25%, transparent 25%);
  background-size: 100px 100px;
  background-color: #eaeaea;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.login-card .form-group+.form-group {
  margin-top: 1rem;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 1.5rem;
}

.login-error {
  background: var(--danger-glow);
  color: var(--danger);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  margin-top: 1rem;
  display: none;
}

/* ─── Cookie Consent Banner ──────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffd700;
  color: #1a1a2e;
  padding: 1.5rem 2rem;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  font-size: 0.95rem;
}

.cookie-banner a {
  color: #1a1a2e;
  text-decoration: underline;
  font-weight: 600;
}

.cookie-banner .cookie-actions {
  display: flex;
  gap: 0.75rem;
}

.cookie-banner .cookie-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.cookie-banner .cookie-btn.accept {
  background: #1a1a2e;
  color: #ffd700;
}

.cookie-banner .cookie-btn.reject {
  background: transparent;
  color: #1a1a2e;
  font-weight: 700;
}

.cookie-banner .cookie-btn:hover {
  transform: translateY(-1px);
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}