/*
 * Wizard UI matching doc/mockup-rediseno.html's dark-tech design system.
 * Reads the active theme's CSS custom properties when present (this plugin
 * is built for the itgroupsolutions theme) and falls back to the same
 * values standalone, so it never looks broken on a different theme — see
 * doc/PLAN-WIZARD-APPOINTMENTS-2026-07-07.md.
 */

.itgs-appointment-form-wrap {
  --itgs-accent: var(--accent, #29B8E3);
  --itgs-accent-2: var(--accent-2, #5EEBD8);
  --itgs-ink: var(--ink, #e9f3f8);
  --itgs-ink-soft: var(--ink-soft, #c4d7e2);
  --itgs-muted: var(--muted, #7f97a6);
  --itgs-line: var(--line, rgba(41, 184, 227, .16));
  --itgs-line-soft: var(--line-soft, rgba(255, 255, 255, .08));
  --itgs-glass-soft: var(--glass-soft, rgba(13, 26, 36, .6));
  --itgs-navy-2: var(--navy-2, #0a1622);
  --itgs-radius: var(--radius, 16px);

  max-width: 640px;
  margin: 0 auto;
  color: var(--itgs-ink-soft);
  font-family: inherit;
}

.itgs-appointment-form {
  display: block;
}

/* Several elements below (.itgs-button, .itgs-field, .itgs-chip...) set
   their own `display`, which otherwise beats the browser's default
   `[hidden]{display:none}` rule on a same-specificity/later-cascade tie —
   e.g. a hidden [data-itgs-prev] (.itgs-btn-ghost, display:inline-flex)
   would render anyway. Force it back, unconditionally. */
.itgs-appointment-form-wrap [hidden] {
  display: none !important;
}

/* ---------- progress bar ---------- */
.itgs-progress {
  display: flex;
  gap: 8px;
  margin: 4px 0 26px;
}

.itgs-progress i {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--itgs-line-soft);
  font-style: normal;
}

.itgs-progress i.on {
  background: linear-gradient(90deg, var(--itgs-accent), var(--itgs-accent-2));
  box-shadow: 0 0 10px rgba(41, 184, 227, .5);
}

/* ---------- step visibility ---------- */
.itgs-wstep {
  display: none;
}

.itgs-wstep.active {
  display: block;
}

.itgs-step-intro {
  font-size: 14.5px;
  color: var(--itgs-muted);
  margin-bottom: 14px;
}

.itgs-step-error {
  margin-top: 12px;
  font-size: 13.5px;
  color: #f2a3a3;
}

/* ---------- step 1: mode choice cards ---------- */
.itgs-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.itgs-choice-opt {
  border: 1.5px solid var(--itgs-line);
  border-radius: var(--itgs-radius);
  padding: 22px;
  cursor: pointer;
  text-align: center;
  transition: .2s;
  background: var(--itgs-glass-soft);
  color: inherit;
  font: inherit;
}

.itgs-choice-opt:hover,
.itgs-choice-opt.sel {
  border-color: var(--itgs-accent);
  background: rgba(41, 184, 227, .1);
  box-shadow: 0 0 20px rgba(41, 184, 227, .15);
}

.itgs-choice-ico {
  color: var(--itgs-accent);
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.itgs-choice-ico .icon {
  width: 32px;
  height: 32px;
}

.itgs-choice-opt b {
  display: block;
  color: var(--itgs-ink);
  margin-bottom: 6px;
}

.itgs-choice-opt p {
  font-size: 13px;
  color: var(--itgs-muted);
  margin: 0;
}

/* ---------- step 2: device-type chips ---------- */
.itgs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 18px;
}

.itgs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--itgs-line);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--itgs-ink-soft);
  background: var(--itgs-glass-soft);
  font-family: inherit;
}

.itgs-chip .icon {
  width: 15px;
  height: 15px;
}

.itgs-chip:hover,
.itgs-chip.sel {
  border-color: var(--itgs-accent);
  background: rgba(41, 184, 227, .14);
  color: var(--itgs-accent-2);
  box-shadow: 0 0 14px rgba(41, 184, 227, .2);
}

/* ---------- step 3: time slot chips ---------- */
.itgs-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
  min-height: 42px;
}

.itgs-slot-chip {
  border: 1.5px solid var(--itgs-line);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  color: var(--itgs-ink-soft);
  background: var(--itgs-glass-soft);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.itgs-slot-time {
  font-size: 13.5px;
  font-weight: 700;
}

.itgs-slot-remaining {
  font-size: 11px;
  color: var(--itgs-muted);
}

.itgs-slot-chip:hover,
.itgs-slot-chip.sel {
  border-color: var(--itgs-accent);
  background: rgba(41, 184, 227, .14);
  box-shadow: 0 0 14px rgba(41, 184, 227, .2);
}

.itgs-slot-chip.sel .itgs-slot-time {
  color: var(--itgs-accent-2);
}

.itgs-slots-message {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--itgs-muted);
  margin: 0;
}

/* ---------- shared field layout (steps 2 and 4) ---------- */
.itgs-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.itgs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.itgs-field:first-child {
  margin-top: 0;
}

/* Inside .itgs-grid, spacing between rows already comes from the grid's
   own `gap` — the DOM-order-based :first-child rule above only zeroes the
   margin on the first item overall, so on a 2-column row (desktop) the
   *second* field (e.g. Email, next to Full Name) still got a stray
   margin-top and sat visibly lower than its row-mate. Reset it for every
   direct grid child instead. */
.itgs-grid > .itgs-field {
  margin-top: 0;
}

.itgs-field--full {
  grid-column: 1 / -1;
}

.itgs-section {
  margin-top: 4px;
}

label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin: 14px 0 6px;
  color: var(--itgs-ink-soft);
}

.itgs-field label {
  margin: 0;
}

.itgs-appointment-form-wrap input,
.itgs-appointment-form-wrap select,
.itgs-appointment-form-wrap textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--itgs-line);
  border-radius: 10px;
  font: inherit;
  font-size: 14.5px;
  background: rgba(255, 255, 255, .03);
  color: var(--itgs-ink);
}

.itgs-appointment-form-wrap input::placeholder,
.itgs-appointment-form-wrap textarea::placeholder {
  color: var(--itgs-muted);
}

.itgs-appointment-form-wrap input:focus,
.itgs-appointment-form-wrap select:focus,
.itgs-appointment-form-wrap textarea:focus {
  outline: none;
  border-color: var(--itgs-accent);
  box-shadow: 0 0 0 3px rgba(41, 184, 227, .15);
}

.itgs-appointment-form-wrap select option {
  background: var(--itgs-navy-2);
  color: var(--itgs-ink);
}

.itgs-appointment-form-wrap input:disabled,
.itgs-appointment-form-wrap select:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---------- step 5: confirmation ---------- */
.itgs-confirm {
  text-align: center;
  padding: 20px 0;
}

.itgs-confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(41, 184, 227, .14);
  border: 1px solid var(--itgs-line);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  box-shadow: 0 0 0 1px rgba(41, 184, 227, .25), 0 0 32px rgba(41, 184, 227, .18);
}

.itgs-confirm-icon .icon {
  width: 32px;
  height: 32px;
  color: var(--itgs-accent);
}

.itgs-confirm-title {
  color: var(--itgs-ink);
  font-size: 22px;
  margin-bottom: 8px;
}

.itgs-confirm-desc {
  color: var(--itgs-muted);
  margin-bottom: 22px;
}

/* ---------- nav + buttons ---------- */
.itgs-wiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.itgs-button,
.itgs-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}

.itgs-button {
  background: linear-gradient(135deg, var(--itgs-accent), var(--itgs-accent-2));
  color: #01161c;
  box-shadow: 0 0 0 1px rgba(41, 184, 227, .3), 0 8px 26px rgba(41, 184, 227, .35);
  margin-left: auto;
}

.itgs-button:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.itgs-btn-ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--itgs-ink);
  border: 1px solid var(--itgs-line-soft);
}

.itgs-confirm .itgs-button {
  margin: 0 auto;
}

/* ---------- alerts + feedback ---------- */
.itgs-alert {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--itgs-line);
  font-size: 14px;
}

.itgs-alert--success {
  border-color: rgba(94, 235, 216, .5);
  color: var(--itgs-accent-2);
}

.itgs-alert--error {
  border-color: #e35a5a;
  color: #f2a3a3;
}

.itgs-help {
  margin: 6px 0 0;
  color: var(--itgs-muted);
  font-size: 12.5px;
}

.itgs-slot-feedback {
  margin-top: 8px;
  color: var(--itgs-muted);
  font-size: 13px;
}

.itgs-slot-feedback.is-error {
  color: #f2a3a3;
}

.itgs-submit-feedback {
  min-height: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
}

.itgs-submit-feedback.is-loading {
  color: var(--itgs-accent-2);
}

.itgs-submit-feedback.is-success {
  color: var(--itgs-accent-2);
}

.itgs-submit-feedback.is-error {
  color: #f2a3a3;
}

@media (max-width: 520px) {
  .itgs-choice {
    grid-template-columns: 1fr;
  }

  .itgs-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .itgs-grid {
    grid-template-columns: 1fr;
  }
}
