/* InCred Client Login popup. Scoped under #icl-panel so Uncode's global input/button styles do not leak in. */
#icl-panel {
  --icl-accent: #f47920;
  --icl-accent-dim: #fcd3b6;
  --icl-text: #1f2933;
  --icl-muted: #6b7280;
  --icl-border: #e3e6ea;
  --icl-error: #c62828;

  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 100000; /* above Uncode header and overlay menus */
  width: 340px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 18px 20px 20px;
  background: #fff;
  color: var(--icl-text);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-family: inherit;
  text-align: left;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#icl-panel[hidden] { display: none; }
#icl-panel.is-open { opacity: 1; transform: none; }

#icl-panel .icl-form { margin: 0; }

#icl-panel .icl-title {
  margin: 0 0 6px;
  padding: 0;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--icl-text);
  letter-spacing: 0;
  text-transform: none;
}

#icl-panel .icl-intro {
  margin: 0 0 14px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  color: var(--icl-muted) !important;
}

#icl-panel .icl-label {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--icl-muted);
  text-transform: none;
  letter-spacing: 0;
}
#icl-panel .icl-req { color: var(--icl-error); margin-left: 2px; }

#icl-panel .icl-input {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid var(--icl-border);
  border-radius: 6px;
  background: #fff;
  color: var(--icl-text);
  font-size: 13px;
  line-height: 40px;
  box-shadow: none;
  outline: none;
}
#icl-panel .icl-input:focus { border-color: var(--icl-accent); box-shadow: 0 0 0 3px rgba(244, 121, 32, 0.15); }
#icl-panel .icl-input[readonly] { background: #f7f8fa; color: var(--icl-muted); }

#icl-panel .icl-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--icl-muted);
}
#icl-panel .icl-status:not(:empty) { margin-top: 10px; }
#icl-panel .icl-status.is-error { justify-content: flex-start; color: var(--icl-error); }

#icl-panel .icl-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid var(--icl-accent-dim);
  border-top-color: var(--icl-accent);
  border-radius: 50%;
  animation: icl-spin 0.7s linear infinite;
}
@keyframes icl-spin { to { transform: rotate(360deg); } }

#icl-panel .icl-choice {
  margin: 12px 0 0;
  padding: 12px 0 0;
  border: 0;
  box-shadow: inset 0 1px 0 var(--icl-border); /* divider; a border-top would wrap around the legend */
  min-width: 0;
}
#icl-panel .icl-choice[hidden] { display: none; }
#icl-panel .icl-legend {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  color: var(--icl-muted);
  border: 0;
  float: left; /* takes the legend out of the fieldset border so it sits on its own line */
  width: 100%;
}
#icl-panel .icl-options { clear: both; display: flex; flex-wrap: wrap; gap: 8px 20px; }
#icl-panel .icl-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--icl-text);
  cursor: pointer;
}
/* Custom-drawn radio. Uncode restyles native radios (appearance: none + its own sizing/pseudo-elements),
   which collapsed them to nothing. These rules redraw the control and win over the theme. */
#icl-panel .icl-option input[type="radio"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  display: inline-block !important;
  position: relative !important;
  flex: 0 0 16px;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1.5px solid #9aa1ab !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  clip: auto !important;
  transform: none !important;
  float: none !important;
  vertical-align: middle;
  cursor: pointer;
}
#icl-panel .icl-option input[type="radio"]:checked {
  border-color: var(--icl-accent) !important;
  background: radial-gradient(circle, var(--icl-accent) 0 4px, #fff 4.5px) !important;
}
#icl-panel .icl-option input[type="radio"]:focus-visible {
  outline: 2px solid var(--icl-accent);
  outline-offset: 2px;
}
#icl-panel .icl-option input[type="radio"]::before,
#icl-panel .icl-option input[type="radio"]::after,
#icl-panel .icl-option::before,
#icl-panel .icl-option::after {
  content: none !important;
  display: none !important;
}

#icl-panel .icl-submit {
  display: block;
  width: 100%;
  height: 38px;
  margin: 14px 0 0;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--icl-accent);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}
#icl-panel .icl-submit:hover:not(:disabled) { filter: brightness(0.95); }
#icl-panel .icl-submit:disabled { background: var(--icl-accent-dim); cursor: not-allowed; }
#icl-panel .icl-submit:focus-visible,
#icl-panel .icl-close:focus-visible { outline: 2px solid var(--icl-accent); outline-offset: 2px; }

#icl-panel .icl-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icl-muted);
  cursor: pointer;
}
#icl-panel .icl-close:hover { background: #f1f3f5; color: var(--icl-text); }

@media (max-width: 767px) {
  #icl-panel {
    top: 50% !important;
    right: auto !important;
    left: 50%;
    width: calc(100vw - 32px);
    max-width: 400px;
    transform: translate(-50%, calc(-50% - 6px));
  }
  #icl-panel.is-open { transform: translate(-50%, -50%); }
  #icl-panel .icl-input { font-size: 16px; } /* stops iOS zoom on focus */
}

@media (prefers-reduced-motion: reduce) {
  #icl-panel { transition: none; }
  #icl-panel .icl-spinner { animation-duration: 2s; }
}
