/* =========================================================================
   OdooGeek — Helpdesk page styles (page-specific)
   -------------------------------------------------------------------------
   Loaded AFTER styles.css, which provides the design tokens (:root), buttons,
   header/footer, .field/input styling, .form-note, .hp-field, [data-reveal]
   and the bilingual .t-el/.t-en visibility. Here we only add the bits unique
   to this page: the purple hero, the triage stepper, SLA chips, the segmented
   toggle controls, custom selects and the drag-&-drop dropzone.

   Palette is reused from styles.css tokens — Odoo aubergine #714B67 + teal.
   ========================================================================= */

/* ---- Active nav item (Helpdesk) ---- */
.main-nav a.is-active { color: var(--purple); position: relative; }
.main-nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--grad-text); border-radius: 2px;
}

/* =========================================================================
   HERO (purple band) — mirrors the site's hero spacing but inverted to purple
   ========================================================================= */
.hd-hero {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  background: var(--grad-cta); color: var(--on-dark);
}
.hd-hero-inner { padding: clamp(54px, 8vw, 96px) 0 clamp(48px, 7vw, 84px); }
.hd-hero-bg { position: absolute; inset: 0; z-index: -1; }
/* Re-tint the shared .blob shapes for the dark hero. */
.hd-hero .blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; }
.hd-hero .blob-1 { width: 460px; height: 460px; background: #9b6f90; top: -170px; right: -60px; }
.hd-hero .blob-2 { width: 360px; height: 360px; background: #1ad0cb; bottom: -130px; left: -80px; opacity: .28; }

/* Eyebrow pill on a dark background. */
.hd-hero .eyebrow {
  color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22);
  box-shadow: none; backdrop-filter: blur(6px);
}
.hd-hero h1 { color: #fff; max-width: 18ch; margin-inline: auto; }
/* Teal-on-white gradient text that still reads on the purple band. */
.grad-text-light {
  background: linear-gradient(120deg, #ffffff 0%, #9fe3df 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hd-hero-sub { color: var(--on-dark); opacity: .92; font-size: 1.18rem; max-width: 52ch; margin: 18px auto 28px; }
.hd-hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
/* Ghost buttons sit on purple here: glassy, light text. */
.hd-hero .btn-ghost {
  background: rgba(255,255,255,.96); color: var(--purple);
}
.hd-hero .btn-ghost:hover { background: #fff; color: var(--purple-700); }
.hd-hero .btn-ghost.hd-hero-secondary {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.5);
}
.hd-hero .btn-ghost.hd-hero-secondary:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }

/* =========================================================================
   TRIAGE STEPPER
   ========================================================================= */
.triage { background: var(--bg); }
.stepper {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
  margin: 0 0 clamp(28px, 4vw, 44px); padding: 0; list-style: none;
}
.step {
  position: relative; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 24px 26px; text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #e3cfdd; }
.step-ico {
  display: inline-grid; place-items: center; width: 60px; height: 60px; font-size: 1.7rem;
  border-radius: 16px; background: linear-gradient(180deg, #f5ecf2, #efe2eb); margin-bottom: 14px;
}
.step-num {
  position: absolute; top: 16px; right: 18px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%; font-family: var(--font-display);
  font-weight: 800; font-size: .82rem; color: #fff; background: var(--purple);
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--text-soft); font-size: .94rem; margin: 0; }

/* Connectors between steps (desktop only); arrow points to the next card. */
.stepper .step:not(:last-child)::after {
  content: "→"; position: absolute; top: 50%; right: -19px; transform: translateY(-50%);
  font-size: 1.2rem; font-weight: 700; color: var(--purple-300); z-index: 2; line-height: 1;
}

/* ---- SLA chips ---- */
.sla-band {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
}
.sla-title {
  margin: 0 0 16px; font-family: var(--font-display); font-weight: 700;
  font-size: 1.02rem; color: var(--ink); text-align: center;
}
.sla-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 14px; }
.sla-chip {
  display: inline-flex; align-items: center; gap: 9px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.sla-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.sla-prio { font-family: var(--font-display); font-weight: 700; font-size: .9rem; color: var(--ink); }
.sla-time { font-size: .86rem; color: var(--text-soft); }
/* Priority colour coding (urgent → low). */
.sla-urgent  .sla-dot { background: #e0563f; }
.sla-high    .sla-dot { background: #e8923a; }
.sla-medium  .sla-dot { background: var(--teal); }
.sla-low     .sla-dot { background: var(--purple-300); }
.sla-urgent { border-color: #f3ccc3; }
.sla-note { margin: 0; text-align: center; font-size: .82rem; color: var(--text-faint); }

/* =========================================================================
   TICKET FORM
   ========================================================================= */
.ticket { background: var(--bg-soft); }
.ticket-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 48px); box-shadow: var(--shadow); max-width: 880px; margin-inline: auto;
}

/* Required-field asterisk. */
.req-mark { color: var(--teal-600); font-weight: 700; }

/* Grouped sections inside the form. */
.form-block { border: 0; margin: 0 0 30px; padding: 0; min-width: 0; }
.form-block:last-of-type { margin-bottom: 22px; }
.form-block > legend {
  padding: 0; margin: 0 0 16px; font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; color: var(--ink); width: 100%; border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

/* Two-column responsive grid for plain fields. */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .field-full { grid-column: 1 / -1; }

/* On the white ticket card, fields use ink text on a soft surface (the base
   .contact-form styling is white-on-purple, so we restyle here for contrast). */
.ticket-form .field { display: flex; flex-direction: column; gap: 6px; }
.ticket-form label,
.ticket-form .seg-label {
  font-size: .84rem; font-weight: 600; color: var(--text); font-family: var(--font-body);
}
.ticket-form .seg-label { display: block; margin-bottom: 10px; }
.ticket-form input[type="text"],
.ticket-form input[type="email"],
.ticket-form input[type="tel"],
.ticket-form textarea,
.ticket-form select {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; width: 100%; transition: border-color .2s, box-shadow .2s, background .2s;
}
.ticket-form input::placeholder,
.ticket-form textarea::placeholder { color: var(--text-faint); }
.ticket-form input:focus,
.ticket-form textarea:focus,
.ticket-form select:focus {
  outline: none; border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,160,157,.18);
}
.ticket-form textarea { resize: vertical; min-height: 120px; }

/* ---- Custom select (caret) ---- */
.select-wrap { position: relative; }
.ticket-form .select-wrap select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 38px; cursor: pointer;
}
.select-caret {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  pointer-events: none; color: var(--purple); font-size: .9rem;
}

/* =========================================================================
   SEGMENTED TOGGLE CONTROLS (real radios styled as a segmented control)
   ========================================================================= */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px;
}
.segmented-narrow { width: auto; }
.seg-option { position: relative; margin: 0; cursor: pointer; }
/* Visually hide the native input but keep it accessible & focusable. */
.seg-option input {
  position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.seg-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 10px; font-family: var(--font-display);
  font-weight: 600; font-size: .92rem; color: var(--text-soft); white-space: nowrap;
  border: 1px solid transparent; transition: background .18s, color .18s, box-shadow .18s, border-color .18s;
}
.seg-option:hover .seg-pill { color: var(--purple); }
/* Selected state → filled purple pill. */
.seg-option input:checked ~ .seg-pill {
  background: var(--purple); color: #fff; box-shadow: 0 8px 18px -10px rgba(113,75,103,.7);
}
/* Urgent option turns red-ish when selected, to signal severity. */
.seg-option-urgent input:checked ~ .seg-pill {
  background: #e0563f; box-shadow: 0 8px 18px -10px rgba(224,86,63,.7);
}
/* Keyboard focus ring on the (hidden) radio shows on the pill. */
.seg-option input:focus-visible ~ .seg-pill { box-shadow: var(--ring); }

/* Live SLA hint under the priority group. */
.seg-sla {
  display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0;
  font-size: .9rem; color: var(--text-soft); background: #eafaf9;
  border: 1px solid #c7efed; border-radius: 999px; padding: 7px 14px;
}
.seg-sla-ico { font-size: 1rem; line-height: 1; }
.seg-sla-text { font-weight: 600; color: var(--teal-600); }

/* =========================================================================
   DROPZONE (drag & drop file input)
   ========================================================================= */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 8px; padding: 30px 22px;
  border: 2px dashed var(--purple-300); border-radius: var(--radius);
  background: var(--bg-soft); cursor: pointer; color: var(--text-soft);
  transition: border-color .2s, background .2s, transform .15s;
}
.dropzone:hover { border-color: var(--purple); background: #faf2f8; }
/* .is-dragover is toggled from helpdesk.js during a drag. */
.dropzone.is-dragover {
  border-color: var(--teal); background: #eafaf9; transform: scale(1.005);
}
/* The native file input fills the label so clicks/keyboard work, but is invisible. */
.dropzone-input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.dropzone-input:focus-visible ~ .dropzone-cta { box-shadow: var(--ring); border-radius: 8px; }
.dropzone-ico { font-size: 1.8rem; line-height: 1; }
.dropzone-cta { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.dz-link { color: var(--teal-600); text-decoration: underline; }
.dropzone-hint { font-size: .84rem; color: var(--text-faint); }

/* Selected-file chips. */
.file-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; padding: 0; }
.file-item {
  display: flex; align-items: center; gap: 10px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
.file-ico { font-size: 1.1rem; line-height: 1; flex: 0 0 auto; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.file-name {
  font-size: .9rem; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size { font-size: .78rem; color: var(--text-faint); }
.file-remove {
  flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: #fff; color: var(--text-soft);
  font-size: 1.1rem; line-height: 1; cursor: pointer; transition: background .15s, color .15s;
}
.file-remove:hover { background: #fbe6e0; color: #d0432b; }

/* =========================================================================
   SUBMIT / NOTES
   ========================================================================= */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 6px; }
.form-actions .btn { flex: 0 0 auto; }
/* Reuse .form-note from styles.css but recolour for the white card. */
.ticket-form .form-note { margin: 0; flex: 1 1 220px; min-height: 1.2em; font-weight: 600; }
.ticket-form .form-note.ok { color: var(--teal-600); }
.ticket-form .form-note.err { color: #d0432b; }
.form-fineprint { margin: 16px 0 0; font-size: .82rem; color: var(--text-faint); }
/* Small hint under a field (e.g. the email "you'll get a reply here" note). */
.field-hint { margin: 6px 0 0; font-size: .8rem; color: var(--text-soft); }
.form-fineprint a { color: var(--teal-600); font-weight: 600; }

.seg-hint { font-weight: 400; color: var(--text-faint); font-size: .92em; }

/* =========================================================================
   APP PICKER — multi-select icon grid (checkboxes styled as shaded tiles)
   ========================================================================= */
.app-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.app-opt { position: relative; margin: 0; cursor: pointer; display: block; }
/* Hide the native checkbox but keep it accessible & focusable. */
.app-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.app-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 14px 8px; min-height: 92px;
  background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 14px;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.app-tile img { width: 40px; height: 40px; object-fit: contain; }
.app-tile > span { font-family: var(--font-display); font-weight: 600; font-size: .76rem; color: var(--text); line-height: 1.15; }
.app-opt:hover .app-tile { border-color: var(--purple-300); transform: translateY(-2px); }
/* Selected → shaded purple tile with a check badge. */
.app-opt input:checked ~ .app-tile { background: #f3e9f0; border-color: var(--purple); box-shadow: 0 8px 20px -12px rgba(113,75,103,.6); }
.app-opt input:checked ~ .app-tile::after {
  content: "✓"; position: absolute; top: 7px; right: 7px; width: 18px; height: 18px;
  display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1;
}
.app-opt input:focus-visible ~ .app-tile { box-shadow: var(--ring); }
/* Custom tile shows a ＋ mark instead of an icon. */
.app-tile-custom .app-other { font-size: 1.8rem; line-height: 1; color: var(--purple); width: 40px; height: 40px; display: grid; place-items: center; }

/* Conditional fields ([hidden] must beat .field's flex display). */
.custom-app[hidden], .mc-company[hidden] { display: none; }

/* =========================================================================
   PRIORITY SLIDER (4-stop scale)
   ========================================================================= */
.prio-slider { --fill: 33.33%; --fill-color: var(--teal); }
.prio-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; margin: 8px 0 4px; cursor: pointer;
  background: linear-gradient(to right, var(--fill-color) 0 var(--fill), var(--line) var(--fill) 100%);
}
.prio-range:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 999px; }
.prio-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--fill-color); box-shadow: var(--shadow); cursor: grab;
}
.prio-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--fill-color); box-shadow: var(--shadow); cursor: grab; }
.prio-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--line); }
.prio-scale { display: flex; margin-top: 4px; }
.prio-scale span { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: .78rem; color: var(--text-faint); text-align: center; transition: color .15s; }
.prio-scale span:first-child { text-align: left; }
.prio-scale span:last-child { text-align: right; }
.prio-scale span.is-active { color: var(--purple); }
.prio-disclaimer { margin: 8px 0 0; font-size: .8rem; color: var(--text-faint); }

/* =========================================================================
   ODOO ERROR (collapsible <details>)
   ========================================================================= */
.error-toggle { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); overflow: hidden; }
.error-summary {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--purple);
}
.error-summary::-webkit-details-marker { display: none; }
.es-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #f3e9f0; color: var(--purple); font-weight: 700; font-size: 1.1rem; line-height: 1; transition: transform .2s; }
.error-toggle[open] .es-ico { transform: rotate(45deg); }
.ticket-form .error-textarea {
  display: block; width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line);
  border-radius: 0 !important; background: #fff !important;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.5;
  padding: 12px 14px; resize: vertical; min-height: 130px; color: var(--ink);
}
.ticket-form .error-textarea:focus { box-shadow: none !important; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 880px) {
  /* Stepper → 2x2; drop the arrow connectors. */
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .stepper .step:not(:last-child)::after { display: none; }
}
@media (max-width: 560px) {
  .stepper { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .segmented { display: flex; width: 100%; }
  .seg-option { flex: 1 1 auto; }
  .seg-pill { width: 100%; padding-inline: 10px; }
  .form-actions .btn { width: 100%; }
}

/* Respect reduced-motion: the base stylesheet already disables transitions,
   but make sure hover lifts don't linger here either. */
@media (prefers-reduced-motion: reduce) {
  .step:hover, .dropzone.is-dragover { transform: none; }
}
