/* K-Red Planning – interface client, couleurs de l'affiche K-Red Dragon */
.kp-app {
  --night: #0C0620;
  --deep: #150A30;
  --raise: #1E1142;
  --violet: #8A3DFF;
  --pink: #FF2E9A;
  --ink: #F4EEFF;
  --muted: #B6A6D9;
  --line: rgba(244, 238, 255, .13);
  --taken: rgba(244, 238, 255, .06);
  --ok: #5CE1B0;
  --bad: #FF6B8A;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  border-radius: 20px;
  padding: clamp(18px, 4vw, 40px);
  max-width: 1120px;
  margin: 0 auto;
  box-sizing: border-box;
  container-type: inline-size;
}
.kp-app *, .kp-app *::before, .kp-app *::after { box-sizing: border-box; }
.kp-app button { font: inherit; color: inherit; cursor: pointer; }
.kp-app button:disabled { cursor: not-allowed; }
.kp-app :focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.kp-app h2, .kp-app h3 { color: var(--ink); margin: 0; }

.kp-layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
.kp-main, .kp-side { min-width: 0; }
/* Une colonne : le récapitulatif s'affiche juste avant le paiement. */
.kp-main { display: contents; }
.kp-side { order: 2; }
.kp-sec-pay { order: 3; }
/* Deux colonnes seulement si le bloc est assez large (le thème peut réduire la largeur du contenu). */
@container (min-width: 820px) {
  .kp-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .kp-main { display: block; }
  .kp-side { position: sticky; top: 24px; }
}
.kp-sec { padding: 26px 0; border-top: 1px solid var(--line); }
.kp-sec:first-child { border-top: 0; padding-top: 0; }
.kp-h { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.05; letter-spacing: .01em; margin-bottom: 16px !important; }
.kp-muted { color: var(--muted); }
.kp-small { font-size: 14px; }
.kp-cap { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.kp-note { font-size: 13px; margin: 10px 0 0; }
.kp-empty { color: var(--muted); margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 12px; }
.kp-loading { color: var(--muted); }

/* Espaces */
.kp-spaces { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.kp-space {
  text-align: left; display: grid; gap: 4px; padding: 18px 20px; border-radius: 16px;
  background: var(--deep); border: 2px solid var(--line);
  transition: border-color .15s, box-shadow .15s;
}
.kp-space strong { font-family: var(--display); font-size: 22px; font-weight: 600; }
.kp-space .kp-price b { font-family: var(--display); font-size: 30px; font-weight: 700; }
.kp-space .kp-sub { color: var(--muted); font-size: 14px; }
.kp-space.on { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), 0 0 24px rgba(138, 61, 255, .35); }
.kp-space:disabled { opacity: .6; }
.kp-soon { display: inline-block; justify-self: start; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--night); background: var(--muted); padding: 3px 10px; border-radius: 99px; }

/* Calendrier */
.kp-calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kp-month { font-family: var(--display); font-size: 24px; font-weight: 600; text-transform: capitalize; }
.kp-nav { width: 44px; height: 44px; border-radius: 50%; background: var(--deep); border: 1px solid var(--line); font-size: 22px; line-height: 1; }
.kp-nav:disabled { opacity: .3; }
#kp-cal { max-width: 520px; }
.kp-dow, .kp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1.2vw, 6px); }
.kp-dow span { text-align: center; color: var(--muted); font-size: 13px; padding-bottom: 4px; }
.kp-days.is-loading { opacity: .5; }
.kp-d {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; padding: 0; border-radius: 12px;
  background: var(--deep); border: 1px solid transparent; font-family: var(--display); font-size: 19px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.kp-d.pad { background: none; }
.kp-d.st-off { background: none; color: rgba(244, 238, 255, .25); }
.kp-d.st-full { background: repeating-linear-gradient(135deg, var(--taken) 0 6px, transparent 6px 12px); color: rgba(244, 238, 255, .35); text-decoration: line-through; }
.kp-d.st-free:hover, .kp-d.st-part:hover { border-color: var(--violet); }
.kp-d.today { border-color: var(--line); }
.kp-d.sel { background: var(--violet); color: #fff; border-color: var(--violet); box-shadow: 0 0 18px rgba(138, 61, 255, .6); }
.kp-occ { position: absolute; left: 22%; right: 22%; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(244, 238, 255, .18); overflow: hidden; }
.kp-occ::after { content: ""; position: absolute; inset: 0; width: calc(var(--o) * 100%); background: var(--pink); }
.kp-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.kp-legend span { display: inline-flex; align-items: center; }
.kp-legend i { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.lg-free { background: var(--deep); border: 1px solid var(--line); }
.lg-part { background: linear-gradient(90deg, var(--pink) 50%, var(--deep) 50%); }
.lg-full { background: repeating-linear-gradient(135deg, rgba(244,238,255,.3) 0 3px, transparent 3px 6px); }

/* Horaire : le tube néon */
.kp-dayname { font-family: var(--display); font-size: 22px; font-weight: 600; margin: 0 0 14px; }
.kp-dayname::first-letter { text-transform: uppercase; }
.kp-dur { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.kp-dur > span { font-weight: 700; }
.kp-dur small { color: var(--muted); font-size: 13px; }
.kp-stepper { display: inline-flex; align-items: center; background: var(--deep); border: 1px solid var(--line); border-radius: 99px; }
.kp-stepper button { width: 46px; height: 46px; border: 0; background: none; font-size: 24px; border-radius: 50%; }
.kp-stepper button:disabled { opacity: .3; }
.kp-stepper output { min-width: 84px; text-align: center; font-family: var(--display); font-size: 24px; font-weight: 700; }
.kp-hint { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.kp-tube { -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent); mask-image: linear-gradient(#000 calc(100% - 36px), transparent); display: grid; max-height: 520px; overflow-y: auto; padding: 14px 18px 14px 0; scrollbar-width: thin; isolation: isolate; }
.kp-row {
  position: relative; display: grid; grid-template-columns: 62px 1fr; align-items: center; min-height: 40px;
  background: none; border: 0; text-align: left; padding: 0;
}
.kp-row .kp-t { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--muted); }
.kp-row .kp-slot {
  position: relative; height: 100%; min-height: 40px; display: flex; align-items: center; padding: 0 16px;
  border-top: 1px solid var(--line); font-size: 14px; font-weight: 700;
}
.kp-row:not(:disabled):hover .kp-slot { background: rgba(138, 61, 255, .14); }
.kp-row:disabled .kp-t { opacity: .45; }
.kp-row.taken .kp-slot { background: repeating-linear-gradient(135deg, var(--taken) 0 8px, transparent 8px 16px); color: var(--muted); font-weight: 500; }
.kp-row.insel .kp-slot {
  background: linear-gradient(90deg, var(--violet), var(--pink));
  color: #fff; border-top-color: transparent;
}
/* Le halo passe derrière toutes les lignes : pas de traits entre les lignes du créneau. */
.kp-row.insel .kp-slot::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: 0 0 24px rgba(255, 46, 154, .5); }
.kp-row.insel .kp-t { color: var(--ink); }
.kp-row.first .kp-slot { border-radius: 14px 14px 0 0; }
.kp-row.last .kp-slot { border-radius: 0 0 14px 14px; }
.kp-row.first.last .kp-slot { border-radius: 14px; }
.kp-end .kp-slot { color: var(--muted); font-weight: 500; }
.kp-range { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 14px 0 0; }

/* Coordonnées */
.kp-fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kp-field { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.kp-field input {
  width: 100%; min-width: 0; height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--deep);
  color: var(--ink); font: 500 17px var(--body);
}
.kp-field input:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(138, 61, 255, .35); }
.kp-types { border: 0; padding: 0; margin: 20px 0 0; }
.kp-types legend { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.kp-types small { color: var(--muted); font-weight: 500; }
#kp-typechips { display: flex; flex-wrap: wrap; gap: 8px; }
.kp-chip { padding: 10px 16px; border-radius: 99px; background: var(--deep); border: 1px solid var(--line); font-size: 15px; }
.kp-chip[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }
.kp-code { margin-top: 20px; }
.kp-link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--muted) !important; font-size: 15px; }
.kp-field-code { max-width: 280px; margin-top: 10px; }
.kp-field-code input { text-transform: uppercase; letter-spacing: .06em; }
.kp-codestate { font-size: 14px; margin: 8px 0 0; min-height: 1em; }
.kp-codestate.ok { color: var(--ok); }
.kp-codestate.bad { color: var(--bad); }

/* Paiement */
.kp-pays { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.kp-payopt { text-align: left; display: grid; gap: 4px; padding: 16px 18px; border-radius: 16px; background: var(--deep); border: 2px solid var(--line); }
.kp-payopt strong { font-family: var(--display); font-size: 22px; font-weight: 700; }
.kp-payopt span { color: var(--muted); font-size: 14px; }
.kp-payopt.on { border-color: var(--pink); box-shadow: 0 0 20px rgba(255, 46, 154, .3); }
.kp-accept { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 15px; }
.kp-accept input { width: 22px; height: 22px; accent-color: var(--pink); flex: none; margin-top: 1px; }
.kp-cond { margin-top: 8px; font-size: 14px; color: var(--muted); }
.kp-cond summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.kp-cond ul { padding-left: 18px; }
.kp-error { color: var(--bad); font-weight: 700; margin: 14px 0 0; min-height: 0; }
.kp-error:empty { display: none; }
.kp-cta {
  margin-top: 18px; width: 100%; min-height: 58px; border: 0; border-radius: 99px; padding: 0 26px;
  background: linear-gradient(90deg, var(--violet), var(--pink)); color: #fff !important;
  font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 26px rgba(255, 46, 154, .4);
}
.kp-cta:disabled { background: var(--raise); box-shadow: none; color: var(--muted) !important; }
.kp-secure { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* Récapitulatif */
.kp-sum, .kp-info { background: var(--deep); border-radius: 18px; padding: 22px; }
.kp-sum { border: 1px solid rgba(138, 61, 255, .5); }
.kp-info { margin-top: 14px; font-size: 14px; }
.kp-sum h3, .kp-info h3 { font-family: var(--display); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.kp-info h3 { font-size: 18px; margin: 14px 0 6px; }
.kp-info h3:first-child { margin-top: 0; }
.kp-info ul { margin: 0; padding-left: 18px; }
.kp-info li { margin: 3px 0; }
.kp-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.kp-dl dt { color: var(--muted); }
.kp-dl dd { margin: 0; text-transform: none; }
.kp-dl dd::first-letter { text-transform: uppercase; }
.kp-warn { color: var(--bad); font-size: 14px; font-weight: 700; margin: 12px 0 0; }
.kp-lines { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.kp-lines td { padding: 4px 0; vertical-align: top; }
.kp-lines td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kp-lines .kp-minus td { color: var(--ok); }
.kp-lines .kp-sep td { border-top: 1px solid var(--line); padding-top: 8px; }
.kp-lines .kp-total td { font-weight: 700; font-size: 16px; }
.kp-now { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.kp-now strong { font-family: var(--display); font-size: 34px; font-weight: 700; color: #fff; text-shadow: 0 0 18px rgba(255, 46, 154, .6); }

/* Barre fixe mobile */
.kp-bar { display: none; }
@media (max-width: 899px) {
  .kp-app { border-radius: 0; padding-bottom: 110px; }
  .kp-bar:not([hidden]) {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; gap: 14px; align-items: center; justify-content: space-between;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: rgba(12, 6, 32, .96); border-top: 1px solid rgba(138, 61, 255, .5);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .kp-bar div { display: grid; }
  .kp-bar small { color: var(--muted); font-size: 13px; }
  .kp-bar strong { font-family: var(--display); font-size: 22px; }
  .kp-cta-s { width: auto; margin: 0; min-height: 48px; font-size: 19px; }
  .kp-tube { max-height: none; -webkit-mask-image: none; mask-image: none; }
}

/* Confirmation */
.kp-done { max-width: 560px; margin: 0 auto; text-align: left; }
.kp-done-k { color: var(--ok); font-weight: 700; margin: 0 0 6px; }
.kp-done h2 { font-family: var(--display); font-size: 40px; line-height: 1; margin-bottom: 20px !important; text-shadow: 0 0 22px rgba(255, 46, 154, .5); }
.kp-done .kp-dl { margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) { .kp-app * { transition: none !important; scroll-behavior: auto !important; } }


/* v1.2 – visites et privatisation, sans paiement en ligne */
.kp-space .kp-price b { font-size: 26px; }
.kp-space .kp-sub small, .kp-dur small { color: var(--muted); }
.kp-spaces-s { margin-top: 18px; }
.kp-spaces-s .kp-space strong { font-size: 19px; }
.kp-dur > span small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.kp-extras { display: grid; gap: 4px; }
.kp-extras .kp-dur { justify-content: space-between; max-width: 420px; }
.kp-badge-ok { margin: 12px 0 0; padding: 12px 16px; border-radius: 12px; background: rgba(92, 225, 176, .12); border: 1px solid rgba(92, 225, 176, .45); color: var(--ok); font-weight: 700; font-size: 14px; }
.kp-note-top { margin: 0 0 12px; }
.kp-paynote { margin: 0 0 6px; padding: 12px 16px; border-radius: 12px; background: var(--deep); border: 1px solid var(--line); font-weight: 700; }
.kp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.kp-field span small { color: var(--muted); font-weight: 500; }
.kp-now span { color: var(--muted); }
[hidden] { display: none !important; }

.kp-app .kp-space, .kp-app .kp-space * { white-space: normal; overflow-wrap: anywhere; }
.kp-app .kp-space { text-transform: none; letter-spacing: normal; line-height: 1.35; height: auto; }

.kp-app .kp-lines, .kp-app .kp-lines tr, .kp-app .kp-lines td { border: 0; background: none; }
.kp-app .kp-lines .kp-sep td { border-top: 1px solid var(--line); }
.kp-app .kp-lines td { border: 0\0; }

/* v1.2.3 – remplissage des visites (sans chiffres) */
.kp-row.has-fill .kp-slot { background: linear-gradient(90deg, rgba(255, 46, 154, .28) var(--f), transparent var(--f)); }
.kp-row.has-fill:not(:disabled):hover .kp-slot { background: linear-gradient(90deg, rgba(255, 46, 154, .4) var(--f), rgba(138, 61, 255, .14) var(--f)); }

/* v1.3 – confirmation par e-mail */
.kp-done .kp-big { font-size: 18px; }
.kp-done-k.kp-wait { color: var(--pink); }
.kp-cta-danger { background: var(--raise) !important; border: 2px solid var(--bad) !important; box-shadow: none !important; }
.kp-cta-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* v1.5 – fond sombre d'origine + quelques zones claires (récapitulatif et infos) */
.kp-app .kp-sum {
background: #FFFFFF; color: #1A0B3D; border: 0;
box-shadow: 0 0 0 2px #FF2E9A, 0 0 34px rgba(255, 46, 154, .45);
}
.kp-app .kp-sum h3 { color: #1A0B3D; }
.kp-app .kp-sum .kp-dl dt, .kp-app .kp-sum .kp-muted { color: #6B5E8C; }
.kp-app .kp-sum .kp-dl dd { color: #1A0B3D; }
.kp-app .kp-sum .kp-lines td { color: #1A0B3D; }
.kp-app .kp-sum .kp-lines .kp-sep td, .kp-app .kp-sum .kp-now { border-top-color: #E6DDF7; }
.kp-app .kp-sum .kp-lines .kp-minus td { color: #0E9F6E; }
.kp-app .kp-sum .kp-now span { color: #6B5E8C; }
.kp-app .kp-sum .kp-now strong { color: #FF2E9A; text-shadow: none; }
.kp-app .kp-sum .kp-warn { color: #D61F69; }
.kp-app .kp-info { background: #EFE9FD; color: #2A1A55; }
.kp-app .kp-info h3 { color: #6A2BD9; }
.kp-app .kp-info .kp-muted { color: #6B5E8C; }
.kp-app .kp-paynote { background: #FFFFFF; color: #1A0B3D; border-color: transparent; }
