/* =====================================================================
   Espace salarié — Identité Layerone (glassmorphism, dégradé du logo)
   Repris du Design System de layerone.fr (variables + components + waves).
   Marque blanche : --primary est injecté par base.html ({{ branding.primary }}),
   utilisé pour les accents unis (focus, liens). Le dégradé reste l'identité
   Layerone de la plateforme.
   ===================================================================== */

:root {
  /* Accent — dégradé du logo Layerone */
  --accent-blue: rgb(66, 133, 255);
  --accent-purple: rgb(140, 100, 240);
  --accent-pink: rgb(236, 72, 180);
  --accent-gradient: linear-gradient(
    135deg,
    var(--accent-blue),
    var(--accent-purple),
    var(--accent-pink)
  );
  /* --primary injecté par base.html ; repli sur le bleu Layerone */
  --primary: var(--accent-blue);

  --text-primary: rgb(51, 64, 89);
  --text-secondary: rgb(102, 115, 140);
  --text-muted: rgb(128, 140, 163);
  --text-placeholder: rgb(153, 166, 179);

  --border-light: rgb(217, 222, 230);
  --background-card: rgba(255, 255, 255, 0.7);
  --background-input: rgba(255, 255, 255, 0.9);
  --bg-grad-1: rgb(248, 250, 255);
  --bg-grad-2: rgb(245, 248, 255);
  --bg-grad-3: rgb(250, 248, 252);

  --success: rgb(0, 160, 66);
  --success-bg: rgba(0, 170, 68, 0.14);
  --danger: rgb(214, 40, 40);
  --danger-bg: rgba(221, 0, 0, 0.1);
  --warning: rgb(200, 120, 0);
  --warning-bg: rgba(255, 150, 0, 0.14);

  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-xl: 24px;
  --r-full: 999px;

  --shadow-card:
    0 20px 40px rgba(30, 40, 90, 0.1), 0 6px 14px rgba(30, 40, 90, 0.06);
  --shadow-accent: 0 8px 22px rgba(140, 100, 240, 0.38);
  --transition: 200ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: rgb(232, 237, 247);
    --text-secondary: rgb(178, 188, 208);
    --text-muted: rgb(140, 150, 172);
    --text-placeholder: rgb(120, 130, 150);
    --border-light: rgba(255, 255, 255, 0.12);
    --background-card: rgba(28, 36, 62, 0.72);
    --background-input: rgba(18, 24, 44, 0.7);
    --bg-grad-1: rgb(12, 15, 30);
    --bg-grad-2: rgb(20, 22, 45);
    --bg-grad-3: rgb(15, 18, 38);
    --success-bg: rgba(0, 200, 90, 0.16);
    --danger-bg: rgba(255, 80, 80, 0.14);
    --warning-bg: rgba(255, 170, 40, 0.16);
    --shadow-card:
      0 20px 44px rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    var(--bg-grad-1),
    var(--bg-grad-2),
    var(--bg-grad-3)
  );
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fond animé à vagues */
.wave-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Barre supérieure (marque) */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  max-width: 560px;
  margin: 0 auto;
}
.logo-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}
.logo {
  height: 34px;
  width: auto;
  border-radius: 8px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.brand .sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Conteneur principal */
.container {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 20px 48px;
}

h1 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
h2 {
  font-size: 16px;
  font-weight: 700;
}
.hint {
  color: var(--text-muted);
  font-size: 13.5px;
}

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0 20px;
}

/* Carte en verre dépoli (.glass = neuf, .card = compat anciens templates) */
.glass,
.card {
  background: var(--background-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-light);
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}

/* .card conserve son comportement de formulaire empilé (login, mot de passe) */
.card {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Champs de saisie */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field > label,
label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field input,
.field select,
.field textarea,
.card input,
.card select {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--background-input);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  outline: none;
  width: 100%;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.field textarea {
  resize: vertical;
  min-height: 64px;
}
.field input::placeholder,
.field textarea::placeholder,
.card input::placeholder {
  color: var(--text-placeholder);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.card input:focus,
.card select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 133, 255, 0.18);
}

/* Champ imbriqué dans un <label> (login/mot de passe) : le label garde le style,
   mais l'input reprend son apparence normale via la règle ci-dessus. */
.card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Boutons */
.btn,
button.cta,
button[type="submit"].cta {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--r-sm);
  padding: 13px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}
.btn-primary,
.cta {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover,
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(140, 100, 240, 0.5);
}
.btn-block {
  width: 100%;
}

.btn-ghost,
.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition);
}
.btn-ghost:hover,
.ghost:hover {
  border-color: var(--primary);
}

.link {
  color: var(--primary);
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  display: block;
}
.link:hover {
  text-decoration: underline;
}

.error {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}
.ok {
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
}

/* Tuiles du tableau de bord */
.grid {
  display: grid;
  gap: 12px;
}
.tile {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 18px;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}
a .tile:hover,
.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(140, 100, 240, 0.16);
}
.tile .ic {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(
    135deg,
    rgba(66, 133, 255, 0.16),
    rgba(140, 100, 240, 0.16),
    rgba(236, 72, 180, 0.12)
  );
}
.tile .t {
  font-weight: 700;
  font-size: 15px;
}
.tile .d {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tile .chev {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 18px;
}
.soon {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 4px 10px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

/* Panneau formulaire (congés / matériel) */
.panel {
  padding: 20px;
  margin-bottom: 22px;
}
.panel h2 {
  margin-bottom: 15px;
}
.form-grid {
  display: grid;
  gap: 14px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* Ligne Civilité/Téléphone : le sélecteur (M./Mme) reste étroit, le téléphone
   prend le reste (2026-07-09, retour Amre : dropdown trop large). */
.row-civ {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
}

/* Lignes (catalogue, historique) */
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}
.item + .item {
  margin-top: 10px;
}
.item.top {
  align-items: flex-start;
}
.item .grow {
  flex: 1;
  min-width: 0;
}
.item .title {
  font-weight: 700;
  font-size: 14px;
}
.item .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.item .reply {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 3px;
}
.qty {
  width: 84px;
  text-align: right;
  padding: 10px 12px;
}
.unit {
  font-size: 12px;
  color: var(--text-muted);
  width: 42px;
  text-align: left;
}

/* Badges d'état */
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.badge.wait {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge.ok {
  background: var(--success-bg);
  color: var(--success);
}
.badge.no {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Alertes */
.alert {
  padding: 12px 15px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.alert.alert-ok {
  background: var(--success-bg);
  color: var(--success);
}
.alert.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Bouton téléchargement (bulletins) */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-gradient);
  color: #fff;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-accent);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 4px 0 12px;
}
.empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 2px;
}

/* Login : centrage vertical + logo agrandi */
.login-wrap {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
}
.login-card {
  width: 100%;
}
.login-head {
  text-align: center;
  margin-bottom: 6px;
}
.login-head .logo-dot {
  width: 54px;
  height: 54px;
  font-size: 26px;
  border-radius: 15px;
  margin: 0 auto 14px;
}

@media (max-width: 480px) {
  .row-2 {
    grid-template-columns: 1fr;
  }
  .row-civ {
    grid-template-columns: 110px 1fr;
  }
}
