/* ======================================================
   Fuhrpark-Portal v2 — Almas Industries Design System
   Mobile-First · SaaS Look · Design Refresh
   ====================================================== */

/* ========================
   CSS CUSTOM PROPERTIES
   ======================== */
:root {
  /* Brand */
  --primary: #C41E2A;
  --primary-dark: #A0151F;
  --primary-light: #E8535E;
  --primary-ghost: rgba(196, 30, 42, .06);
  --secondary: #2D3436;
  --secondary-light: #636E72;

  /* Semantic */
  --success: #27AE60;
  --success-light: #E8F8F0;
  --warning: #F39C12;
  --warning-light: #FEF5E7;
  --danger: #E74C3C;
  --danger-light: #FDEDEC;
  --info: #3498DB;
  --info-light: #EBF5FB;

  /* Neutrals */
  --bg: #F5F6FA;
  --white: #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100: #F1F2F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-900: #2D3436;

  /* Radii */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .03);
  --shadow: 0 2px 8px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .1), 0 4px 12px rgba(0, 0, 0, .06);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, .14);

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --duration: .2s;
  --transition: all var(--duration) var(--ease);
  --transition-slow: all .35s var(--ease);
}

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ========================
   HEADER
   ======================== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .92);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-brand img {
  height: 40px;
  width: auto;
  transition: var(--transition);
}

.header-brand h1 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: -.3px;
  white-space: nowrap;
}

.header-brand h1 span {
  color: var(--primary);
}

/* Nav Pills */
.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.header-nav::-webkit-scrollbar { display: none; }

.header-nav a {
  color: var(--secondary-light);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 40px;
  justify-content: center;
}

.header-nav a:hover {
  color: var(--primary);
  background: var(--primary-ghost);
}

.header-nav a.active {
  color: var(--white);
  background: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(196, 30, 42, .25);
}

.header-nav .nav-logout {
  color: var(--gray-400);
  margin-left: 4px;
}

.header-nav .nav-logout:hover {
  color: var(--danger);
  background: var(--danger-light);
}

@media (min-width: 769px) {
  .header { padding: 0 24px; }
  .header-inner { height: 64px; gap: 16px; }
  .header-nav a { padding: 8px 16px; font-size: .875rem; }
}

/* ========================
   CONTAINER
   ======================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.container-narrow { max-width: 640px; }

@media (min-width: 769px) {
  .container { padding: 24px; }
}

/* ========================
   CARDS
   ======================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
  transition: box-shadow var(--duration) var(--ease);
  border: 1px solid rgba(0, 0, 0, .04);
}

.card:hover {
  box-shadow: var(--shadow);
}

@media (min-width: 769px) {
  .card { padding: 24px; margin-bottom: 20px; }
}

.card-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header i { color: var(--primary); width: 20px; height: 20px; }

@media (min-width: 769px) {
  .card-header { font-size: 1.05rem; margin-bottom: 20px; padding-bottom: 16px; }
}

/* ========================
   STATS GRID
   ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, .04);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon i { width: 20px; height: 20px; }
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-content { min-width: 0; }

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
  letter-spacing: -.5px;
}

.stat-label {
  font-size: .7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

@media (min-width: 769px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
  .stat-card { padding: 20px; gap: 16px; }
  .stat-icon { width: 48px; height: 48px; }
  .stat-icon i { width: 24px; height: 24px; }
  .stat-value { font-size: 1.75rem; }
  .stat-label { font-size: .8rem; }
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 48px;
  min-width: 48px;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.btn:active { transform: scale(.97); }
.btn i { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: #C41E2A !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(196, 30, 42, .25);
}

.btn-primary:hover {
  background: #A0151F !important;
  box-shadow: 0 4px 12px rgba(196, 30, 42, .3);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(39, 174, 96, .25);
}

.btn-success:hover {
  background: #219A52;
  box-shadow: 0 4px 12px rgba(39, 174, 96, .3);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(231, 76, 60, .25);
}

.btn-danger:hover {
  background: #C0392B;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--secondary-light);
}

.btn-ghost:hover { background: var(--gray-100); color: var(--secondary); }

.btn-sm { padding: 6px 12px; font-size: .8rem; min-height: 36px; min-width: 36px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; pointer-events: none; }

/* ========================
   FORMS
   ======================== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group label .required { color: var(--primary); }

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
  min-height: 48px;
  color: var(--gray-900);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 42, .1);
}

.form-control::placeholder { color: var(--gray-400); }

select.form-control {
  appearance: auto;
  -webkit-appearance: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

/* Search field */
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-wrap .form-control {
  padding-left: 42px;
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.search-wrap .form-control:focus {
  background: var(--white);
  border-color: var(--primary);
}

@media (min-width: 769px) {
  .search-wrap { margin-bottom: 20px; }
}

/* Radio/Checkbox groups */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-group label, .check-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  font-size: .88rem;
  min-height: 48px;
  transition: var(--transition);
  border: 2px solid transparent;
  user-select: none;
  touch-action: manipulation;
}

.radio-group label:hover, .check-group label:hover {
  background: var(--gray-100);
}

.radio-group input:checked + span,
.check-group input:checked + span { font-weight: 700; }

.radio-group label:has(input:checked),
.check-group label:has(input:checked) {
  background: var(--primary-ghost);
  border-color: var(--primary);
  color: var(--primary);
}

/* ========================
   STATUS BADGES (Pills)
   ======================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge-gesendet { background: var(--info-light); color: var(--info); }
.badge-geoeffnet { background: var(--warning-light); color: #B45309; }
.badge-abgeschlossen { background: var(--success-light); color: #166534; }
.badge-abgelaufen { background: var(--danger-light); color: #991B1B; }

/* Fuel badges */
.badge-fuel { padding: 4px 10px; font-size: .7rem; font-weight: 600; }
.badge-benzin { background: #FEF3C7; color: #92400E; }
.badge-diesel { background: var(--gray-100); color: var(--gray-600); }
.badge-elektro { background: var(--success-light); color: #166534; }
.badge-hybrid { background: var(--info-light); color: #1E40AF; }
.badge-plugin-hybrid { background: #EDE9FE; color: #5B21B6; }

/* Zustand-Status */
.zustand-ok { color: var(--success); font-weight: 600; }
.zustand-mangel { color: var(--warning); font-weight: 600; }
.zustand-schaden { color: var(--danger); font-weight: 600; }

/* ========================
   TABLE
   ======================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

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

th, td {
  padding: 10px 12px;
  text-align: left;
}

th {
  background: var(--gray-50);
  font-weight: 700;
  color: var(--gray-500);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--gray-200);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

td { border-bottom: 1px solid var(--gray-100); }

/* Zebra striping */
tr:nth-child(even) td { background: var(--gray-50); }
tr:hover td { background: rgba(196, 30, 42, .02); }

td .actions { display: flex; gap: 4px; }

@media (min-width: 769px) {
  table { font-size: .875rem; }
  th, td { padding: 14px 16px; }
}

/* Driver avatar */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  color: var(--white);
  background: var(--primary);
  flex-shrink: 0;
}

.driver-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-cell strong { font-weight: 600; }

@media (min-width: 769px) {
  .avatar { width: 36px; height: 36px; font-size: .8rem; }
}

/* ========================
   PHOTO UPLOAD
   ======================== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.photo-slot {
  aspect-ratio: 4/3;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  position: relative;
  background: var(--gray-50);
  min-height: 100px;
  touch-action: manipulation;
}

.photo-slot:hover {
  border-color: var(--primary);
  background: var(--primary-ghost);
}

.photo-slot:active {
  transform: scale(.98);
}

.photo-slot.has-photo { border-style: solid; border-color: var(--success); }

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.photo-slot .photo-label {
  font-size: .7rem;
  color: var(--gray-500);
  text-align: center;
  padding: 4px 8px;
  z-index: 1;
  font-weight: 600;
}

.photo-slot .photo-icon {
  font-size: 1.8rem;
  color: var(--gray-400);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-slot .photo-icon i { width: 28px; height: 28px; }

.photo-slot .remove-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--danger);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  min-height: 30px;
}

.photo-slot .remove-photo:hover { background: #C0392B; transform: scale(1.1); }

@media (min-width: 640px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* ========================
   SIGNATURE PAD
   ======================== */
.signature-area {
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  touch-action: none;
  cursor: crosshair;
}

.signature-area canvas { display: block; width: 100%; height: 150px; }
.signature-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ========================
   FORM SECTIONS (Accordion)
   ======================== */
.form-section {
  margin-bottom: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.form-section:hover {
  box-shadow: var(--shadow-sm);
}

.form-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--secondary);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  min-height: 52px;
  user-select: none;
  transition: background var(--duration) var(--ease);
  gap: 12px;
  touch-action: manipulation;
}

.form-section-header:hover { background: #3D4749; }

.form-section-header .section-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-header .section-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .7rem;
  transition: var(--transition);
}

.form-section-header .section-check.done {
  background: var(--success);
  border-color: var(--success);
}

.form-section-header .toggle {
  transition: transform .25s var(--ease);
  flex-shrink: 0;
}

.form-section-header.collapsed .toggle { transform: rotate(-90deg); }

.form-section-body {
  padding: 16px;
  animation: sectionOpen .25s var(--ease);
}

.form-section-body.collapsed { display: none; }

@keyframes sectionOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 769px) {
  .form-section { margin-bottom: 16px; }
  .form-section-header { padding: 16px 20px; min-height: 56px; font-size: .95rem; }
  .form-section-body { padding: 20px; }
}

/* ========================
   LOGIN
   ======================== */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #1a2025 40%, var(--primary-dark) 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(196, 30, 42, .12) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(52, 152, 219, .06) 0%, transparent 50%);
  pointer-events: none;
}

.login-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  animation: loginIn .4s var(--ease);
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  height: 40px;
  width: auto;
  margin-bottom: 16px;
}

.login-logo h1 {
  color: var(--secondary);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.5px;
}

.login-logo h1 span { color: var(--primary); }

.login-logo .subtitle {
  color: var(--gray-500);
  font-size: .85rem;
  margin-top: 4px;
}

@media (min-width: 769px) {
  .login-box { padding: 40px; max-width: 420px; }
  .login-logo img { height: 48px; }
  .login-logo h1 { font-size: 1.5rem; }
  .login-logo { margin-bottom: 32px; }
}

/* ========================
   TOAST NOTIFICATIONS
   ======================== */
.toast-container {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius);
  color: var(--white);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease);
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================
   MODAL
   ======================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: fadeIn .2s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .25s var(--ease);
}

@keyframes modalIn {
  from { transform: scale(.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 700;
}

.modal-close {
  background: var(--gray-100);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-500);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  min-height: 36px;
}

.modal-close:hover { background: var(--gray-200); color: var(--secondary); }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (min-width: 769px) {
  .modal-header { padding: 20px 24px; }
  .modal-body { padding: 24px; }
  .modal-footer { padding: 16px 24px; }
}

/* ========================
   LOADING / SPINNER
   ======================== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

/* ========================
   PROGRESS BAR
   ======================== */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-full);
  transition: width .4s var(--ease);
}

.progress-text {
  font-size: .75rem;
  color: var(--gray-500);
  font-weight: 600;
  text-align: right;
  margin-bottom: 6px;
}

@media (min-width: 769px) {
  .progress-bar { height: 8px; margin-bottom: 20px; }
  .progress-text { font-size: .8rem; }
}

/* ========================
   EMPTY STATE
   ======================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state .empty-icon i { width: 24px; height: 24px; color: var(--gray-400); }
.empty-state p { font-size: .9rem; font-weight: 500; }

.empty-state .empty-hint {
  font-size: .82rem;
  color: var(--gray-400);
  margin-top: 4px;
}

@media (min-width: 769px) {
  .empty-state { padding: 48px 24px; }
  .empty-state .empty-icon { width: 64px; height: 64px; margin-bottom: 16px; }
  .empty-state .empty-icon i { width: 28px; height: 28px; }
  .empty-state p { font-size: .95rem; }
}

/* ========================
   FORM PAGE HEADER
   ======================== */
.form-page-header {
  background: var(--secondary);
  color: var(--white);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.form-page-header .header-inner {
  height: 52px;
}

.form-page-header h1 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--white);
}

.form-page-header .form-type-badge {
  font-size: .72rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .15);
  color: var(--white);
  font-weight: 600;
  backdrop-filter: blur(4px);
}

@media (min-width: 769px) {
  .form-page-header { padding: 0 20px; }
  .form-page-header .header-inner { height: 56px; }
  .form-page-header h1 { font-size: 1rem; }
}

/* Floating submit */
.floating-submit {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
  z-index: 50;
}

.floating-submit .btn {
  font-size: 1rem;
  padding: 16px;
  border-radius: var(--radius-lg);
  min-height: 52px;
}

@media (min-width: 769px) {
  .floating-submit { padding: 16px 20px; }
  .floating-submit .btn { font-size: 1.05rem; }
}

/* Success/Error states */
.state-card {
  text-align: center;
  padding: 40px 20px;
}

.state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.state-icon.success { background: var(--success-light); color: var(--success); }
.state-icon.error { background: var(--danger-light); color: var(--danger); }
.state-icon.loading { background: var(--gray-100); }
.state-icon i { width: 32px; height: 32px; }

@media (min-width: 769px) {
  .state-card { padding: 48px 24px; }
  .state-icon { width: 72px; height: 72px; margin-bottom: 20px; }
  .state-icon i { width: 36px; height: 36px; }
}

/* Link result card */
.link-result {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--success-light);
  border-radius: var(--radius);
  border: 1px solid rgba(39, 174, 96, .2);
}

.link-result a {
  color: var(--success);
  word-break: break-all;
  font-weight: 600;
  font-size: .82rem;
}

/* ========================
   UTILITY
   ======================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }

@media (min-width: 769px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ========================
   FOCUS RING (a11y)
   ======================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========================
   SCROLLBAR (subtle)
   ======================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ========================
   SELECTION
   ======================== */
::selection {
  background: rgba(196, 30, 42, .15);
  color: var(--secondary);
}
