/* ============================================================
   APPLIZ — Feuille de style principale
   Palette : bleu nuit / blanc / cyan électrique
   ============================================================ */

:root {
  --bg:        #080f1e;
  --bg2:       #0d1a2d;
  --surface:   #112040;
  --border:    #1d3557;
  --accent:    #00d4ff;
  --accent2:   #0ea5e9;
  --text:      #e8f4fd;
  --muted:     #6b8aad;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0,212,255,.08);
  --font-main: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

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

/* ============================================================
   Navigation
   ============================================================ */
.appliz-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center;
  padding: 0 32px;
  height: 64px;
  background: rgba(8,15,30,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand-link {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.2rem;
  letter-spacing: -.3px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #000; font-size: 1rem;
}
.brand-name { background: linear-gradient(90deg, var(--accent), #fff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-menu {
  margin-left: auto;
  display: flex; align-items: center; gap: 4px;
}

.nav-link {
  color: var(--muted); padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: .9rem;
  transition: color .2s, background .2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface); }
.nav-link-admin { color: var(--accent) !important; }

.btn-nav-cta {
  background: var(--accent); color: #000; font-weight: 700;
  padding: 8px 18px; border-radius: 8px; font-size: .9rem;
  transition: opacity .2s;
}
.btn-nav-cta:hover { color: #000; opacity: .85; }

.nav-user { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%; color: #000; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; text-transform: uppercase;
}
.user-email { color: var(--muted); font-size: .85rem; }
.btn-logout { color: var(--muted); padding: 4px 8px; }
.btn-logout:hover { color: var(--danger); }

/* ============================================================
   Layout principal
   ============================================================ */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-hero {
  text-align: center;
  padding: 80px 24px 60px;
}
.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.1;
}
.gradient-text {
  background: linear-gradient(90deg, var(--accent), #60a5fa, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero p {
  color: var(--muted); font-size: 1.1rem;
  max-width: 560px; margin: 0 auto 32px;
}

/* ============================================================
   Cartes
   ============================================================ */
.card-appliz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.kpi-value { font-size: 2.2rem; font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.kpi-label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.kpi-icon  { font-size: 1.5rem; color: var(--accent); margin-bottom: 12px; }

/* ============================================================
   Formulaires
   ============================================================ */
.form-appliz .form-label { color: var(--muted); font-size: .875rem; font-weight: 500; margin-bottom: 6px; }

.form-appliz .form-control,
.form-appliz .form-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-appliz .form-control:focus,
.form-appliz .form-select:focus {
  background: var(--bg2);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,.15);
  color: var(--text);
  outline: none;
}
.form-appliz .form-control::placeholder { color: var(--muted); }

/* Zone email principale */
.email-input-wrap {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
}
.email-input-wrap input {
  flex: 1; min-width: 280px;
  background: var(--bg2); border: 1.5px solid var(--border);
  color: var(--text); border-radius: 12px;
  padding: 16px 20px; font-size: 1.05rem;
  font-family: var(--font-mono);
  transition: border-color .2s, box-shadow .2s;
}
.email-input-wrap input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,212,255,.12);
}

/* ============================================================
   Boutons
   ============================================================ */
.btn-primary-appliz {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000; font-weight: 700; border: none;
  padding: 14px 28px; border-radius: 12px;
  font-size: .95rem; cursor: pointer;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
}
.btn-primary-appliz:hover { opacity: .9; transform: translateY(-1px); color: #000; }
.btn-primary-appliz:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary-appliz {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 10px;
  font-size: .9rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-secondary-appliz:hover { background: var(--border); color: #fff; }

/* ============================================================
   Score / Résultats
   ============================================================ */
.score-ring-wrap { text-align: center; padding: 20px 0; }
.score-number { font-size: 3.5rem; font-weight: 700; font-family: var(--font-mono); }
.score-label  { color: var(--muted); font-size: .9rem; }

.risk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: .875rem; font-weight: 600;
}
.risk-low    { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.risk-medium { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.risk-high   { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }

.type-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  background: rgba(0,212,255,.1); color: var(--accent);
  border: 1px solid rgba(0,212,255,.2);
}

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: .9rem; display: flex; align-items: flex-start; gap: 8px;
}
.check-list li:last-child { border-bottom: none; }

.check-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.check-row:last-child { border-bottom: none; }
.check-ok  { color: var(--success); }
.check-err { color: var(--danger); }
.check-warn{ color: var(--warning); }

/* Barre de score */
.score-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.score-high   { background: linear-gradient(90deg, var(--success), #4ade80); }
.score-medium { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.score-low    { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ============================================================
   Tableau
   ============================================================ */
.table-appliz {
  width: 100%; border-collapse: collapse;
}
.table-appliz th {
  color: var(--muted); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.table-appliz td {
  padding: 14px 16px; font-size: .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-appliz tr:last-child td { border-bottom: none; }
.table-appliz tr:hover td { background: rgba(29,53,87,.4); }
.table-wrap { overflow-x: auto; }

/* ============================================================
   Flash messages
   ============================================================ */
.flash {
  padding: 14px 20px; border-radius: 10px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px; font-size: .9rem;
}
.flash-success { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.flash-danger  { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.flash-warning { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.flash-info    { background: rgba(0,212,255,.12);  color: var(--accent); border: 1px solid rgba(0,212,255,.25); }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-box {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.auth-box h2 { font-size: 1.6rem; font-weight: 700; margin: 0 0 6px; }
.auth-box p.sub { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }

/* ============================================================
   Footer
   ============================================================ */
.appliz-footer {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-brand { color: var(--muted); font-size: .875rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); font-size: .875rem; }
.footer-links a:hover { color: var(--text); }

/* ============================================================
   Hero landing
   ============================================================ */
.hero-big {
  min-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 60px 24px;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 800px 400px at 50% 20%, rgba(0,212,255,.06), transparent),
    radial-gradient(ellipse 600px 300px at 80% 80%, rgba(14,165,233,.05), transparent);
}
.hero-big h1 { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 700; margin: 0 0 20px; line-height: 1.05; }
.hero-big .sub { font-size: 1.15rem; color: var(--muted); max-width: 580px; margin: 0 auto 40px; }
.hero-features {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-top: 60px;
}
.hero-feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  text-align: left; max-width: 260px; flex: 1;
}
.hero-feature-icon { font-size: 1.6rem; color: var(--accent); margin-bottom: 10px; }
.hero-feature h4  { font-size: .95rem; margin: 0 0 6px; }
.hero-feature p   { color: var(--muted); font-size: .85rem; margin: 0; }

/* ============================================================
   Upload zone
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0,212,255,.04);
}
.upload-zone i { font-size: 2.5rem; color: var(--muted); margin-bottom: 12px; }

/* ============================================================
   Tabs
   ============================================================ */
.tab-bar {
  display: flex; gap: 4px; background: var(--bg2);
  border-radius: 10px; padding: 4px; margin-bottom: 28px;
}
.tab-btn {
  flex: 1; padding: 10px; border: none; background: none;
  color: var(--muted); font-family: var(--font-main); font-size: .9rem;
  cursor: pointer; border-radius: 8px; transition: .2s;
}
.tab-btn.active { background: var(--surface); color: var(--text); font-weight: 600; }

/* ============================================================
   Progress bar
   ============================================================ */
.progress-appliz {
  background: var(--border); border-radius: 4px; height: 8px;
}
.progress-appliz-bar {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .5s;
}

/* ============================================================
   Spinner
   ============================================================ */
.spinner-appliz {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(0,212,255,.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Page admin
   ============================================================ */
.admin-sidebar {
  position: sticky; top: 80px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 0;
}
.admin-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: var(--muted); font-size: .9rem;
  border-left: 3px solid transparent;
  transition: .2s;
}
.admin-nav-link:hover, .admin-nav-link.active {
  color: var(--text); background: rgba(0,212,255,.06);
  border-left-color: var(--accent);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .appliz-nav { padding: 0 16px; }
  .nav-menu { gap: 2px; }
  .user-email { display: none; }
  .page-wrap { padding: 24px 16px 60px; }
  .auth-box  { padding: 28px 20px; }
}

@media (max-width: 576px) {
  .email-input-wrap { flex-direction: column; }
  .email-input-wrap input { min-width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
}
