/* <leanox-contact-form> styles (#669). Every colour, radius and font comes
   from a custom property the host page sets, so the same form takes the
   website's look on leanox.ai and the dashboard's on app.leanox.ai. The
   fallbacks are neutral, for a host that sets nothing. */

leanox-contact-form {
  /* A block with no height of its own: the pop-up is fixed-position, so the
     element must not add a line to the page it sits on. */
  display: block;
  height: 0;
  --lcf-bg-fallback: #ffffff;
  font-family: var(--lcf-font, system-ui, sans-serif);
  color: var(--lcf-text, #1f2937);
}

.lcf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--lcf-backdrop, rgb(0 0 0 / 0.5));
  backdrop-filter: blur(4px);
}

.lcf-dialog {
  position: fixed;
  z-index: 1001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px;
  background: var(--lcf-bg, var(--lcf-bg-fallback));
  color: var(--lcf-text, #1f2937);
  border: 1px solid var(--lcf-border, #d1d5db);
  border-radius: var(--lcf-dialog-radius, 16px);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.3);
}

@media (max-width: 480px) {
  .lcf-dialog {
    width: calc(100vw - 16px);
    padding: 20px 16px;
  }
}

.lcf-backdrop[hidden],
.lcf-dialog[hidden],
.lcf-field[hidden],
.lcf-form[hidden],
.lcf-done[hidden],
.lcf-error[hidden],
.lcf-status[hidden] {
  display: none;
}

/* Invisible tab stops at both ends of the dialog that send focus back in. */
.lcf-guard {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lcf-close {
  float: right;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--lcf-muted, #6b7280);
  cursor: pointer;
}

.lcf-title {
  margin: 0;
  font-family: var(--lcf-title-font, inherit);
  font-size: var(--lcf-title-size, 26px);
  font-weight: var(--lcf-title-weight, 600);
  color: var(--lcf-title-color, inherit);
}

.lcf-subtitle {
  margin: 6px 0 20px;
  color: var(--lcf-muted, #6b7280);
}

.lcf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lcf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .lcf-row {
    grid-template-columns: 1fr;
  }
}

.lcf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lcf-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--lcf-label, inherit);
}

.lcf-optional {
  font-weight: 400;
  color: var(--lcf-muted, #6b7280);
}

.lcf-input {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--lcf-text, #1f2937);
  background: var(--lcf-field-bg, #ffffff);
  border: 1px solid var(--lcf-border, #d1d5db);
  border-radius: var(--lcf-radius, 10px);
  padding: 10px 14px;
}

.lcf-input:focus {
  outline: 2px solid var(--lcf-focus, var(--lcf-accent, #2563eb));
  outline-offset: 1px;
}

.lcf-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lcf-input[aria-invalid="true"] {
  border-color: var(--lcf-danger, #b91c1c);
}

.lcf-textarea {
  min-height: 140px;
  resize: vertical;
}

.lcf-error,
.lcf-status {
  margin: 0;
  font-size: 14px;
  color: var(--lcf-danger, #b91c1c);
}

.lcf-consent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--lcf-muted, #6b7280);
}

.lcf-consent p {
  margin: 0;
}

.lcf-consent label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lcf-text, #1f2937);
  font-weight: 600;
}

.lcf-protected {
  margin: 0;
  font-size: 12px;
  color: var(--lcf-muted, #6b7280);
}

.lcf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.lcf-send,
.lcf-done-close {
  border: 0;
  border-radius: 999px;
  padding: 11px 24px;
  font: inherit;
  font-weight: 600;
  background: var(--lcf-accent, #2563eb);
  color: var(--lcf-accent-text, #ffffff);
  cursor: pointer;
}

.lcf-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lcf-done-text {
  margin: 8px 0 20px;
  font-size: 17px;
}

/* A note rather than an error: the account changed in another tab. */
.lcf-status.lcf-notice {
  color: var(--lcf-text, #1f2937);
}
