/* ===================================================================
   Otis by KCO — Design System
   Brand: Deep Ocean Blue #29265B · Fresh Mint #68BC95
          Lime Glow #DEE279 · Frosty #ECEDF8 · Grapefruit #ED6D5E
=================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=clash-grotesk@400,500,600,700&display=swap');

:root {
  --blue:       #29265B;
  --mint:       #68BC95;
  --lime:       #DEE279;
  --frosty:     #ECEDF8;
  --grapefruit: #ED6D5E;
  --text:       #1a1829;
  --muted:      #6b7280;
  --border:     #e2e4f0;
  --white:      #ffffff;
  --shadow-sm:  0 2px 8px rgba(41,38,91,.06);
  --shadow:     0 4px 28px rgba(41,38,91,.10);
  --shadow-lg:  0 8px 48px rgba(41,38,91,.14);
  --radius:     16px;
  --radius-sm:  10px;
}

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

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--frosty);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ── Site Header (public) ────────────────────────────────────────── */
.site-header {
  background: var(--blue);
  height: 62px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-name {
  font-family: 'Clash Grotesk', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--white);
  letter-spacing: -.3px;
}

.logo-tag {
  background: var(--lime);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.logo-kco {
  height: 26px;
  width: auto;
  display: block;
  opacity: .92;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--white); background: rgba(255,255,255,.1); }

.btn-nav-logout {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.2);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  margin-left: 4px;
}
.btn-nav-logout:hover { background: rgba(255,255,255,.18); }

/* ── Topbar (authenticated shell) ────────────────────────────────── */
.topbar {
  background: var(--blue);
  height: 62px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar .brand {
  font-family: 'Clash Grotesk', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .brand-tag {
  background: var(--lime);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.topbar .logo-kco {
  height: 24px;
  width: auto;
  display: block;
  opacity: .9;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar nav a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.topbar nav a:hover { color: var(--white); background: rgba(255,255,255,.1); }

.topbar nav button {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.2);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  margin-left: 6px;
}
.topbar nav button:hover { background: rgba(255,255,255,.18); }

/* ── Page layout ─────────────────────────────────────────────────── */
.public-container, .container {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.public-footer {
  background: var(--blue);
  color: rgba(255,255,255,.45);
  text-align: center;
  padding: 18px 24px;
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.card + .card { margin-top: 16px; }

.card-accent { border-top: 3px solid var(--mint); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--lime);
  color: var(--blue);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  padding: 13px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .1s;
  box-shadow: 0 4px 16px rgba(222,226,121,.45);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-outline:hover { background: var(--frosty); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--blue);
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--mint); background: #f5fffA; }

/* ── Typography ──────────────────────────────────────────────────── */
h1 {
  font-family: 'Clash Grotesk', 'Poppins', sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.5px;
  color: var(--blue);
  margin-bottom: 12px;
}

h2 {
  font-family: 'Clash Grotesk', 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 16px;
}

h3 {
  font-family: 'Clash Grotesk', 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 10px;
}

.lead {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.small { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }

/* ── Forms ───────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(41,38,91,.08);
}

select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
select:focus { border-color: var(--blue); }

/* Field wrapper spacing */
.field { margin-bottom: 16px; }

/* ── Password field — copie 1:1 du composant Ptit-Me ─────────────────
   Tailwind source (login/page.tsx) :
     input  : w-full rounded-xl border border-frosty-dark bg-white pl-10 pr-10
              py-2.5 text-sm text-ocean placeholder:text-ocean-300 outline-none
              transition-all focus:border-mint focus:ring-2 focus:ring-mint/20
     lock   : absolute left-3 top-1/2 -translate-y-1/2 text-ocean-300 pointer-events-none
     toggle : absolute right-3 top-1/2 -translate-y-1/2 text-ocean-300
              hover:text-ocean-600 transition-colors
   Palette Tailwind (tailwind.config.ts) :
     ocean=#29265B  ocean-300=#8a87ca  ocean-600=#403d8d  ocean-700=#333072
     mint=#68BC95   frosty-dark=#d8daf0
─────────────────────────────────────────────────────────────────── */
.password-wrap { position: relative; }

/* On surcharge totalement input[type=password|text] DANS .password-wrap
   pour ignorer le style global de l'input et reprendre exactement celui de Ptit-Me. */
.password-wrap input[type="password"],
.password-wrap input[type="text"] {
  width: 100%;
  border: 1px solid #d8daf0;            /* border-frosty-dark */
  border-radius: 12px;                   /* rounded-xl */
  background: #ffffff;
  padding: 10px 40px;                    /* py-2.5 px-10 */
  font-family: inherit;
  font-size: 14px;                       /* text-sm */
  color: #29265B;                        /* text-ocean */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.password-wrap input[type="password"]::placeholder,
.password-wrap input[type="text"]::placeholder {
  color: #8a87ca;                        /* placeholder:text-ocean-300 */
}
.password-wrap input[type="password"]:focus,
.password-wrap input[type="text"]:focus {
  border-color: #68BC95;                 /* focus:border-mint */
  box-shadow: 0 0 0 2px rgba(104, 188, 149, 0.2); /* focus:ring-2 ring-mint/20 */
}

.password-lock {
  position: absolute;
  left: 12px;                            /* left-3 */
  top: 50%;
  transform: translateY(-50%);
  color: #8a87ca;                        /* text-ocean-300 */
  pointer-events: none;
  display: inline-flex;
  line-height: 0;
}
.password-lock svg { width: 16px; height: 16px; display: block; stroke-width: 2; }

.password-toggle {
  position: absolute;
  right: 12px;                           /* right-3 */
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #8a87ca;                        /* text-ocean-300 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: color .15s;                /* transition-colors */
}
.password-toggle:hover { color: #403d8d; /* hover:text-ocean-600 */ }
.password-toggle:focus { outline: none; }
.password-toggle:focus-visible {
  outline: 2px solid #68BC95;
  outline-offset: 2px;
  border-radius: 4px;
}
.password-toggle svg { width: 16px; height: 16px; display: block; stroke-width: 2; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-revealed .icon-eye { display: none; }
.password-toggle.is-revealed .icon-eye-off { display: block; }

/* ── Alert ───────────────────────────────────────────────────────── */
.alert-error {
  background: #fff5f5;
  border: 1.5px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  border-left: 4px solid var(--grapefruit);
}

/* ── Auth layout ─────────────────────────────────────────────────── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand .product-name {
  font-family: 'Clash Grotesk', 'Poppins', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -.5px;
}

.auth-brand .product-tag {
  display: inline-block;
  background: var(--lime);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}

.auth-brand .product-sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 24px;
}

/* ── Drop zone ───────────────────────────────────────────────────── */
.drop {
  border: 2px dashed var(--border);
  border-radius: 14px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--frosty);
  padding: 36px 24px;
  text-align: center;
}
.drop:hover { border-color: var(--mint); background: #f0faf5; }
.drop.dragover { border-color: var(--blue); background: #f0f0fb; }

.drop-icon { font-size: 38px; line-height: 1; }
.drop-title { font-weight: 700; font-size: 17px; color: var(--blue); }
.drop-sub { font-size: 14px; color: var(--muted); }
.drop-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.drop-filename { font-size: 13px; color: var(--mint); font-weight: 600; margin-top: 4px; }

.file-hidden { display: none; }

/* ── Checkboxes (opt) ────────────────────────────────────────────── */
.opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  transition: border-color .15s, background .15s;
  user-select: none;
}
.opt:has(input:checked) { border-color: var(--blue); background: var(--frosty); }
.opt input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Progress bar ────────────────────────────────────────────────── */
.progress {
  display: none;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  font-size: 14px;
}
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block !important; }

.bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--frosty);
  overflow: hidden;
  margin-top: 12px;
}

.barfill {
  height: 100%;
  width: 28%;
  background: linear-gradient(90deg, var(--blue), var(--mint));
  border-radius: 999px;
  animation: kco-slide 1.2s infinite ease-in-out;
}

@keyframes kco-slide {
  0%   { transform: translateX(-160%); }
  100% { transform: translateX(480%); }
}

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

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead tr { border-bottom: 2px solid var(--border); }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  padding: 10px 16px;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }

/* ── Status badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-done    { background: #dcfce7; color: #15803d; }
.badge-pending { background: var(--frosty); color: var(--blue); }
.badge-running { background: #fef3c7; color: #92400e; }
.badge-failed  { background: #fee2e2; color: #b91c1c; }

/* ── Code / pre ──────────────────────────────────────────────────── */
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f1729;
  color: #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  font-size: 13px;
  line-height: 1.75;
  max-height: 500px;
  overflow: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ── Grid helpers ────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Speaker card (job detail) ───────────────────────────────────── */
.speaker-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.speaker-card:hover { border-color: var(--mint); }

.speaker-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--blue);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.speaker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--frosty);
  border-radius: 999px;
  font-size: 13px;
}

.speaker-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
  font-style: italic;
  border-left: 3px solid var(--mint);
  padding-left: 12px;
}

/* ── Misc ────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.text-center { text-align: center; }
.mb0 { margin-bottom: 0; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mt32 { margin-top: 32px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 30px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .topbar, .site-header { padding: 0 16px; }
  .public-container, .container { padding: 24px 16px; }
  .card { padding: 20px; }
}
