:root {
  --ei-bg: #f3f6ef;
  --ei-surface: rgba(255, 255, 255, 0.92);
  --ei-line: rgba(15, 118, 110, 0.14);
  --ei-primary: #0f766e;
  --ei-primary-strong: #115e59;
  --ei-warm: #d97706;
  --ei-ink: #14281d;
  --ei-muted: #4b635a;
  --ei-shadow: 0 22px 56px rgba(20, 40, 29, 0.12);
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  color: var(--ei-ink);
  background:
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.16), transparent 26%),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.2), transparent 34%),
    linear-gradient(180deg, #eef7f5 0%, var(--ei-bg) 45%, #edf2ea 100%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.screen-stack { display: grid; gap: 1rem; }

.public-app-shell, .public-auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.public-topbar,
.public-auth-card,
.public-form-panel,
.public-section-card,
.public-kpi-card,
.public-history-card,
.public-notification-item,
.public-photo-card {
  background: var(--ei-surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--ei-line);
  box-shadow: var(--ei-shadow);
}

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 1rem 0.75rem;
  border-radius: 0 0 28px 28px;
}

.public-topbar-row, .public-topbar-brand, .public-topbar-actions, .public-location-head, .public-section-head, .public-history-main, .public-history-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.public-topbar-row, .public-location-head, .public-section-head, .public-history-main { justify-content: space-between; }
.public-topbar-brand { align-items: center; }
.public-topbar-logo, .public-brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  padding: 0.7rem;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.16), rgba(17, 94, 89, 0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}
.public-topbar-title { font-size: 1.05rem; font-weight: 800; }
.public-topbar-subtitle { color: var(--ei-muted); font-size: 0.8rem; }
.public-client-chip, .public-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15, 118, 110, 0.16);
  color: var(--ei-muted);
  font-weight: 700;
  font-size: 0.82rem;
}

.public-main { padding: 1rem 1rem 6rem; }
.public-bottom-nav {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  padding: 0.7rem;
  border-radius: 24px;
  background: rgba(20, 40, 29, 0.92);
  box-shadow: 0 24px 48px rgba(20, 40, 29, 0.22);
}
.public-bottom-nav a {
  min-height: 58px;
  border-radius: 18px;
  color: rgba(255,255,255,0.72);
  display: grid;
  place-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.public-bottom-nav a.active {
  background: linear-gradient(135deg, var(--ei-primary), var(--ei-primary-strong));
  color: white;
}
.public-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--ei-primary-strong);
}
.public-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dc2626, #f97316);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
}
.public-notification-panel {
  margin-top: 0.9rem;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--ei-line);
}
.public-notification-item {
  padding: 0.95rem 1rem;
  border-radius: 18px;
}
.public-notification-item.is-read { opacity: 0.68; }
.public-notification-item p, .public-history-card p, .public-dashboard-hero p { margin: 0; color: var(--ei-muted); }
.public-notification-item span, .public-history-meta span { color: var(--ei-muted); font-size: 0.8rem; }
.public-dashboard-hero, .public-hero-card {
  padding: 1.35rem;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(15, 118, 110, 0.92), rgba(17, 94, 89, 0.85)), linear-gradient(135deg, #115e59, #d97706);
  color: white;
  box-shadow: 0 30px 60px rgba(15, 118, 110, 0.25);
}
.public-dashboard-hero h2, .public-hero-card h1, .public-section-head h3 { margin: 0 0 0.4rem; font-weight: 800; }
.public-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.public-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.public-kpi-card {
  padding: 1.1rem;
  border-radius: 22px;
}
.public-kpi-card span { display: block; color: var(--ei-muted); font-size: 0.82rem; }
.public-kpi-card strong { display: block; font-size: 1.5rem; margin: 0.25rem 0 0.35rem; }
.public-kpi-card small { color: var(--ei-muted); }
.public-kpi-card.accent-warm { background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255,255,255,0.95)); }
.public-kpi-card.accent-soft { background: linear-gradient(180deg, rgba(240, 253, 250, 0.98), rgba(255,255,255,0.95)); }
.public-section-card,
.public-form-panel,
.public-auth-card,
.public-photo-card,
.public-history-card { padding: 1.1rem; border-radius: 24px; }
.public-section-head.stacked { flex-direction: column; align-items: flex-start; }
.public-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.public-form-stack { display: grid; gap: 1rem; margin-top: 1rem; }
.public-location-card {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(244, 250, 249, 0.92);
  border: 1px dashed rgba(15, 118, 110, 0.28);
}
.public-map { height: 240px; border-radius: 18px; overflow: hidden; margin-top: 0.9rem; }
.public-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.15rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ei-warm), #b45309);
  border: 0;
  color: white;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(217, 119, 6, 0.25);
}
.public-inline-note, .public-empty-state {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px dashed rgba(15, 118, 110, 0.22);
  color: var(--ei-muted);
}
.public-empty-state.compact { padding: 0.8rem 0.95rem; }
.public-history-card { display: grid; gap: 0.85rem; }
.public-history-main { align-items: flex-start; }
.public-history-meta { flex-wrap: wrap; }
.public-status-chip {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.status-soumis { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.status-prise_en_charge { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.status-assigne_technicien { background: rgba(14, 165, 233, 0.14); color: #0369a1; }
.status-en_cours { background: rgba(16, 185, 129, 0.14); color: #047857; }
.status-resolu, .status-ferme { background: rgba(34, 197, 94, 0.16); color: #166534; }
.public-photo-card { padding: 0.95rem 1rem; }
.public-photo-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.65rem; color: var(--ei-muted); }
.public-auth-card { max-width: 760px; margin: 0 auto; padding: 1rem; }
.public-auth-shell {
  display: grid;
  padding: max(env(safe-area-inset-top), 0.85rem) 1rem max(env(safe-area-inset-bottom), 0.85rem);
  align-items: center;
}
.public-auth-shell-login {
  overflow: hidden;
}
.public-auth-card-login {
  width: min(100%, 680px);
  padding: 0.9rem;
  display: grid;
  gap: 0.8rem;
}
.public-auth-card-login .public-hero-card {
  padding: 1rem 1rem 0.95rem;
  border-radius: 24px;
}
.public-auth-card-login .public-brand-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 0.75rem;
}
.public-auth-card-login .public-hero-pill {
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
}
.public-auth-card-login .public-hero-card h1 {
  margin: 0.65rem 0 0.35rem;
  font-size: clamp(1.45rem, 3.8vw, 1.8rem);
}
.public-auth-card-login .public-hero-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.42;
}
.public-auth-card-login .public-auth-switch {
  margin-top: 0;
  padding: 0.8rem 0.95rem;
}
.public-auth-card-login .public-form-stack {
  margin-top: 0;
  gap: 0.85rem;
}
.public-auth-card-login .form-label {
  margin-bottom: 0.35rem;
}
.public-auth-card-login .form-control {
  min-height: 46px;
}
.public-auth-card-login .public-cta {
  justify-content: center;
  min-height: 52px;
  margin-top: 0.15rem;
}
.public-hero-card p { color: rgba(255,255,255,0.84); }
.public-brand-mark { margin-bottom: 1rem; }
.public-auth-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15, 118, 110, 0.14);
  color: var(--ei-muted);
}
.public-auth-switch a {
  font-weight: 800;
  color: var(--ei-primary-strong);
}

.public-splash-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.public-splash-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.7;
}
.public-splash-orb-a {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.32), transparent 70%);
  top: -32px;
  right: -32px;
  animation: public-float-a 4.2s ease-in-out infinite;
}
.public-splash-orb-b {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.28), transparent 72%);
  bottom: -24px;
  left: -24px;
  animation: public-float-b 4.8s ease-in-out infinite;
}
.public-splash-card {
  position: relative;
  width: min(100%, 420px);
  padding: 2rem 1.5rem;
  text-align: center;
  border-radius: 32px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(15, 118, 110, 0.16);
  box-shadow: 0 30px 60px rgba(20, 40, 29, 0.16);
  backdrop-filter: blur(20px);
}
.public-splash-logo-shell {
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  padding: 1rem;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.16), rgba(217, 119, 6, 0.12));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.public-splash-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--ei-ink);
}
.public-splash-subtitle {
  margin-top: 0.5rem;
  color: var(--ei-muted);
}
.public-splash-loader {
  display: inline-flex;
  gap: 0.45rem;
  margin-top: 1.2rem;
}
.public-splash-loader span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ei-primary), var(--ei-warm));
  animation: public-loader 1s ease-in-out infinite;
}
.public-splash-loader span:nth-child(2) { animation-delay: 0.15s; }
.public-splash-loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes public-loader {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes public-float-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-8px, 10px, 0) scale(1.05); }
}

@keyframes public-float-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(10px, -8px, 0) scale(1.06); }
}

@media (max-width: 860px) {
  .public-kpi-grid, .public-grid-two { grid-template-columns: 1fr; }
  .public-auth-switch { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .public-auth-shell-login {
    padding: max(env(safe-area-inset-top), 0.7rem) 0.85rem max(env(safe-area-inset-bottom), 0.7rem);
  }

  .public-auth-card-login {
    padding: 0.8rem;
    gap: 0.7rem;
  }

  .public-auth-card-login .public-hero-card {
    padding: 0.95rem 0.9rem 0.9rem;
  }

  .public-auth-card-login .public-auth-switch {
    padding: 0.75rem 0.85rem;
    gap: 0.35rem;
  }

  .public-auth-card-login .public-form-stack {
    gap: 0.75rem;
  }
}

@media (max-height: 760px) {
  .public-auth-shell-login {
    align-items: start;
  }

  .public-auth-card-login .public-hero-card {
    padding: 0.9rem 0.95rem 0.85rem;
  }

  .public-auth-card-login .public-brand-mark {
    width: 48px;
    height: 48px;
    margin-bottom: 0.6rem;
  }

  .public-auth-card-login .public-hero-card h1 {
    font-size: 1.35rem;
    margin: 0.55rem 0 0.25rem;
  }

  .public-auth-card-login .public-hero-card p {
    font-size: 0.88rem;
    line-height: 1.35;
  }
}
