/*
 * Styles for the Crisp contact-form plugin, so the form inside the homepage's
 * "Send us a message" dialog matches the site.
 *
 * This file is NOT loaded by any page on this site. Crisp loads it inside its own
 * iframe: Crisp dashboard -> Plugins -> Contact Form -> Customization -> HTML code:
 *   <link rel="stylesheet" href="https://www.cloudunifi.com/css/crisp-contact-form.css?v=1" type="text/css" />
 * Bump ?v= there after changing this file (browsers cache it for hours).
 *
 * It overrides Crisp's own classes (.form, .form-field, .button, .privacy,
 * .acknowledge, .form-warning). If Crisp renames them the form falls back to
 * Crisp's default look; nothing breaks.
 */

@font-face {
  font-family: "Inter";
  src: url("https://www.cloudunifi.com/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Crisp sets --theme-accent from --color-blue and colours the button with
   .button--blue, so redefining the blue pair re-themes both, whatever the order
   of the stylesheets. */
html:root {
  --color-blue: #1E0E62;
  --color-blue-light: #2A1880;
  --theme-accent: #1E0E62;
  --cu-ink: #1E0E62;
  --cu-body: #4C5A6B;
  --cu-hairline: #C9CCDB;
}

body,
.form-font-regular,
.form-font-semibold,
.form-font-bold,
input,
textarea,
select,
button {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  color: var(--cu-ink);
}

/* The iframe spans the dialog edge to edge, so the side padding here is what lines the
   fields up with the dialog's title (24px; 16px on phones, see the media query below). */
.form-wrapper {
  padding: 4px 24px 8px;
}

/* Fields */
.form-field {
  margin-top: 14px;
}

.form-field.form-field--spaced {
  margin-top: 14px;
}

input,
textarea,
select {
  color: var(--cu-ink);
  border: 1px solid var(--cu-hairline);
  border-radius: 10px;
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  letter-spacing: 0;
  line-height: 1.4;
  padding-left: 14px;
  padding-right: 14px;
}

.form-field select,
.form-field input,
.form-field textarea {
  padding-top: 30px;
  padding-bottom: 11px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #A9A6C4;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cu-ink);
  box-shadow: 0 0 0 3px rgba(79, 61, 245, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: #6B7688;
}

/* Crisp floats each label over the top of its field on a white strip */
.form-field label,
input + label,
textarea + label,
select + label {
  color: var(--cu-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 18px;
  padding: 8px 0 2px 14px;
  top: 1px;
  left: 1px;
  right: 16px;
  border-radius: 9px 0 0 0;
}

input:focus + label,
textarea:focus + label,
select:focus + label {
  color: var(--cu-ink);
}

.form textarea {
  min-height: 190px;
}

.form legend {
  color: var(--cu-body);
  font-size: 13px;
  letter-spacing: 0;
  line-height: 18px;
  margin-top: 8px;
  margin-left: 2px;
}

/* Button */
.form button,
.button {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  min-height: 50px;
  padding: 14px 22px;
  margin-top: 20px;
  border-radius: 10px;
  box-shadow: none;
}

.button:hover,
.button:focus {
  box-shadow: none;
}

.button:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 61, 245, 0.35);
}

/* Crisp dims a disabled button to 0.6; keep the label readable on indigo */
button:disabled,
button:disabled:hover,
button:disabled:active {
  opacity: 0.55;
}

/* Footer note and links */
.branding,
.privacy {
  font-size: 12.5px;
  line-height: 18px;
  margin-top: 18px;
}

.branding,
.branding a,
.privacy,
.privacy a {
  color: var(--cu-body);
}

a {
  color: var(--cu-ink);
}

/* Error box and the "message sent" state */
.form-warning {
  border: 1px solid #CC0606;
  border-radius: 10px;
  margin-top: 18px;
}

.form-warning p {
  color: var(--cu-ink);
}

.acknowledge-title {
  color: var(--cu-ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.acknowledge-label {
  color: var(--cu-body);
  font-size: 16px;
  line-height: 1.5;
}

@media screen and (max-width: 480px) {
  .form-wrapper {
    padding-left: 16px;
    padding-right: 16px;
  }

  .form textarea {
    min-height: 150px;
  }

  .form button {
    margin-top: 18px;
  }
}
