/* ════════════════════════════════════════════════════════════════════════
   NeuroArsho — Persian (Jalali) date field
   Renders the <jalali-date> tag helper output: a Persian-digits text box plus
   the calendar popup created by wwwroot/js/jalali-picker.js.
   Loaded by every layout that includes neuromind-auth.css for its tokens.
   ════════════════════════════════════════════════════════════════════════ */

/* Field wrapper: keeps the visible box and the hidden ISO input stacked. */
.jp-field { position: relative; display: block; }

.jp-field .jp-input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.jp-field--invalid .jp-input {
  border-color: var(--nm-danger, #ff5a76) !important;
  box-shadow: 0 0 0 3px rgba(255, 90, 118, 0.15);
}

/* ── Popup ──────────────────────────────────────────────────────────── */

.jp-popup {
  position: absolute;
  z-index: 1080;
  width: 268px;
  padding: 12px;
  display: grid;
  gap: 10px;
  font-family: var(--nm-font, inherit);
  color: var(--nm-text, #e9f3ff);
  background: var(--nm-field-fill, #0b1626);
  border: 1px solid var(--nm-cyan-border, rgba(0, 212, 255, 0.25));
  border-radius: var(--nm-radius-widget, 14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.jp-popup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.jp-popup__label {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--nm-cyan-soft, #4dd8ff);
  font-variant-numeric: tabular-nums;
}

.jp-popup__nav {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--nm-muted, #8ca3c8);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.jp-popup__nav:hover { color: var(--nm-text, #e9f3ff); border-color: var(--nm-cyan-border, rgba(0, 212, 255, 0.25)); background: rgba(0, 212, 255, 0.08); }

.jp-popup__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.jp-popup__wd {
  display: grid;
  place-items: center;
  padding: 4px 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--nm-muted, #8ca3c8);
}

.jp-popup__cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--nm-text, #e9f3ff);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.jp-popup__cell--empty { cursor: default; }
.jp-popup__day:hover { background: rgba(0, 212, 255, 0.12); }
.jp-popup__day.is-selected { background: var(--nm-gradient, linear-gradient(135deg, #19d3f3, #3b6bff)); color: #fff; font-weight: 800; }
.jp-popup__day:focus-visible { outline: 2px solid var(--nm-cyan, #00d4ff); outline-offset: 1px; }

/* ── Time row (datetime fields only) ────────────────────────────────── */

.jp-popup__time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--nm-border, rgba(255, 255, 255, 0.06));
}

.jp-popup__num {
  width: 52px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--nm-text, #e9f3ff);
  background: var(--nm-field-fill, #0b1626);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
}

.jp-popup__num:focus { border-color: var(--nm-cyan-border, rgba(0, 212, 255, 0.25)); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15); }
.jp-popup__colon { font-weight: 700; color: var(--nm-muted, #8ca3c8); }

.jp-popup__ok {
  margin-right: auto;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--nm-gradient, linear-gradient(135deg, #19d3f3, #3b6bff));
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.jp-popup__ok:hover { filter: brightness(1.08); }

@media (prefers-reduced-motion: reduce) {
  .jp-popup__nav, .jp-popup__cell { transition: none; }
}
