/* assets/css/join.css - "Add a missing place" form (/join). Tokens from places.css. */

.jnPage { max-width: 760px; }
.jnHero { margin: 0 0 22px; }
.jnLead { margin: 0 0 18px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.jnSteps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: jnstep;
}
.jnSteps li {
  position: relative;
  padding: 12px 14px 12px 46px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: #3B4658;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  counter-increment: jnstep;
}
body.rtl .jnSteps li { padding: 12px 46px 12px 14px; }
.jnSteps li::before {
  content: counter(jnstep);
  position: absolute;
  top: 11px;
  inset-inline-start: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

/* ---------- cards ---------- */
.jnForm { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.jnForm[hidden] { display: none; }
.jnTrap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* no offset: left:-10000px made RTL pages scroll sideways */
.jnCard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: #fff;
}
.jnCard h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.jnCard h2 + .jnHint { margin-top: -10px; }
.jnNum {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
}
.jnReq, .jnOpt { margin-inline-start: 4px; font-size: 12px; font-weight: 600; }
.jnReq { color: var(--blue); }
.jnOpt { color: var(--muted); font-weight: 400; }

.jnField { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jnLabel { font-size: 15px; font-weight: 700; }
.jnHint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.jnHint a { color: var(--muted); }
.jnRow { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.jnGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.jnInput {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;                 /* no zoom on iOS */
  outline: none;
}
textarea.jnInput { resize: vertical; line-height: 1.5; }
.jnInput:focus { border-color: var(--blue); }
.jnInput:disabled { background: var(--bg); color: var(--muted); }
.jnInput[hidden] { display: none; }

/* name in several languages */
.jnLangs { display: flex; flex-direction: column; gap: 8px; }
.jnLangInput { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; }
.jnLangInput span { color: var(--muted); font-size: 14px; }

/* chips (group) */
.jnChips { display: flex; flex-wrap: wrap; gap: 8px; }
.jnChip { position: relative; }
.jnChip input, .jnSeg input { position: absolute; opacity: 0; pointer-events: none; }
.jnChip span, .jnChip img { position: relative; }
.jnChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.jnChip img { width: 18px; height: 18px; object-fit: contain; }
.jnChip:hover { border-color: #C5CBD6; }
.jnChip:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.jnChip:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }

/* segmented buttons (floor, section, who) */
.jnSeg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); }
.jnSeg label { position: relative; cursor: pointer; }
.jnSeg span {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}
.jnSeg label:hover span { color: var(--ink); }
.jnSeg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(21, 34, 51, .08); }
.jnSeg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 1px; }
.jnSeg--floors span { min-width: 40px; padding: 0; }
.jnSeg--wide { display: grid; grid-template-columns: 1fr 1fr; }
.jnSeg--wide span { padding: 8px 12px; text-align: center; font-weight: 600; line-height: 1.3; }

.jnSections summary { color: var(--muted); font-size: 14px; line-height: 1.45; cursor: pointer; }
.jnSections img { display: block; max-width: 360px; width: 100%; margin-top: 10px; }

/* shop number: 4 yellow boxes like the signs in the station */
.jnDigits { display: flex; gap: 6px; }
.jnDigits .bn {
  width: 48px;
  height: 56px;
  border: 0;
  border-radius: 6px;
  background: #F9DF6D;
  color: #140D8A;
  font: inherit;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  outline: none;
}
.jnDigits .bn:focus { box-shadow: 0 0 0 3px var(--blue); }

.jnCheck { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.jnCheck input { width: 18px; height: 18px; accent-color: var(--blue); }

/* mark on the map */
.jnPin[hidden] { display: none; }
.jnPinMap {
  position: relative;
  height: 340px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--bg);
  isolation: isolate;
}
.jnPinMap[hidden] { display: none; }
.jnPinMap .leaflet-container { background: var(--bg); cursor: crosshair; }
.jnPinMap .floorSvg { width: 100%; height: 100%; }
.jnPinMap .poi { background: none; border: 0; }
.jnPinMap .poiInner {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 2px solid var(--blue); box-shadow: 0 0 0 6px rgba(55, 73, 240, .18);
}
.jnPinMap .poiInner img { width: 18px; height: 18px; }
/* places already on the map (context): small and faded, the new pin stands out */
.jnPinMap .poi--dim .poiInner { border-color: #fff; box-shadow: 0 1px 2px rgba(21, 34, 51, .12); opacity: .55; transform: scale(.75); }
.jnPinMap .poi--dim:hover .poiInner { opacity: 1; }
.jnLinkBtn { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.jnLinkBtn[hidden] { display: none; }

/* hours */
.jnHoursTools { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.jnHours { display: flex; flex-direction: column; gap: 8px; }
.jnDay { display: grid; grid-template-columns: 110px 1fr auto 1fr auto; align-items: center; gap: 8px; }
.jnDayName { font-weight: 600; }
.jnDash { color: var(--muted); }
.jnTime { min-height: 42px; padding: 6px 10px; }
.jnDay.is-closed .jnTime { opacity: .4; }
.jnHours.is-same .jnDay:not(:first-child) { display: none; }
.jnHours.is-same .jnDay:first-child .jnDayName { display: none; }
.jnHours.is-same .jnDay:first-child { grid-template-columns: 1fr auto 1fr auto; }
.jnHours.is-24 { display: none; }

/* errors */
.jnError { margin: 0; color: #C0341D; font-size: 14px; font-weight: 600; }
.jnError[hidden] { display: none; }
.has-error .jnInput, .has-error .jnChip, .has-error .jnSeg { border-color: #E3786A; }
.has-error .jnSeg { box-shadow: inset 0 0 0 2px #E3786A; }

/* submit */
.jnSubmit { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 6px; }
.jnBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 15px 28px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(55, 73, 240, .17);
}
.jnBtn:hover { filter: brightness(1.1); color: #fff; }
.jnBtn:disabled { opacity: .6; cursor: default; }
.jnBtn--ghost { background: #fff; color: var(--ink); border: 2px solid var(--stroke); box-shadow: none; }
.jnBtn--ghost:hover { color: var(--blue); border-color: var(--blue); filter: none; }

/* done */
.jnDone { margin: 10px 0 60px; padding: 40px 24px; border-radius: 20px; background: #fff; border: 1px solid var(--stroke); text-align: center; outline: none; }
.jnDone[hidden] { display: none; }
.jnDoneIcon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #1FA463; color: #fff; font-size: 32px; font-weight: 800; }
.jnDone h2 { margin: 0 0 8px; font-size: 26px; }
.jnDone p { margin: 0 auto 22px; max-width: 460px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.jnDoneActions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 600px) {
  .jnSteps { grid-template-columns: 1fr; gap: 6px; }
  .jnSteps li { padding-top: 10px; padding-bottom: 10px; }
  .jnHours.is-same .jnDay:first-child { grid-template-columns: 1fr 1fr; }
  .jnCard { padding: 18px 16px; border-radius: 16px; }
  .jnGrid { grid-template-columns: 1fr; }
  .jnLangInput { grid-template-columns: 1fr; gap: 4px; }
  .jnDay { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .jnDayName { grid-column: 1 / -1; }
  .jnDash { display: none; }
  .jnClosed { grid-column: 1 / -1; }
  .jnSeg--wide { grid-template-columns: 1fr; }
  .jnSubmit { align-items: stretch; }
  .jnPinMap { height: 300px; }
}

/* ---------- admin mode (localhost): saves straight into database.js ---------- */
.jnAdmin {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #F3D27A;
  border-radius: 12px;
  background: #FFF6DD;
  color: #5A4500;
  font-size: 14px;
  line-height: 1.45;
}
.jnLangInput--top { align-items: start; }
.jnLangInput--top span { padding-top: 12px; }
.jnCard[hidden] { display: none; }

/* ---------- desktop: form in a wide sidebar, floor plan on the right (like the map page) ---------- */
.jnMapPane { display: none; }
@media (min-width: 1000px) {
  body.jn-split { --jn-side: min(640px, 50vw); }
  body.jn-split .content { max-width: none; margin: 0; padding: 0; }   /* the site's centred column */
  body.jn-split .jnPage {
    box-sizing: border-box;
    width: var(--jn-side);
    max-width: none;
    margin: 0;
    padding-inline: 32px;
  }
  body.jn-split .jnSteps { grid-template-columns: 1fr; gap: 6px; }
  body.jn-split .jnSteps li { padding-top: 10px; padding-bottom: 10px; }

  body.jn-split .jnMapPane {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: calc(100% - var(--jn-side));
    z-index: 50;                        /* over the footer, under the header buttons */
    background: var(--bg, #F3F4F7);
    border-inline-start: 1px solid var(--stroke, #E3E6EC);
  }
  body.jn-split .jnMapPane .jnPinMap {
    position: absolute;
    inset: 0;
    height: auto;
    border: 0;
    border-radius: 0;
  }
  body.jn-split .jnMapPane.is-empty .jnPinMap { opacity: .25; pointer-events: none; }

  /* floor buttons, like on the map page */
  .jnPaneFloors {
    position: absolute;
    top: 76px;
    inset-inline-end: 12px;
    z-index: 600;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .jnPaneFloor {
    width: 44px;
    height: 44px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #fff;
    color: var(--muted, #6B7686);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 1px 6px rgba(21, 34, 51, .06);
    cursor: pointer;
  }
  .jnPaneFloor:hover { color: var(--ink, #152233); }
  .jnPaneFloor.is-on { border-color: var(--blue, #3749F0); color: var(--blue, #3749F0); }

  .jnPaneHint {
    position: absolute;
    bottom: 22px;
    left: 50%;
    z-index: 600;
    max-width: calc(100% - 48px);
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--ink, #152233);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(21, 34, 51, .08);
    transform: translateX(-50%);
    pointer-events: none;
  }
}
