/* ILNU — enquiry widget styles */

/*
 * Brand colours. Every accent in the widget reads from these, so re-theming
 * is a change here rather than a hunt through the file.
 */
:root {
  /* ILNU yellow — the whole form panel. */
  --accent: #ffc662;
  --accent-text: white;
  /* ILNU blue — Submit and the OTP buttons. */
  --button: #00529b;
  --button-hover: #003f78;
  --button-disabled: #7fa6cc;
  --button-text: white;
  --checkbox: white;
  --field-bg: white;
  --text: #111;
  --placeholder: #222;
  --error: #9b0000;
  --verified: #1a8d3f;
  --disabled-bg: rgb(203, 201, 201);
  --disabled-text: rgb(90, 88, 88);
}

html,
body {
  padding: 0;
  margin: 0;
  height: auto;
}

#box {
  width: 100%;
  height: auto;
  margin: auto;
  color: var(--accent-text);
  font-family: "Lato", sans-serif;
  font-size: 10px;
}

.full-container {
  position: relative;
  background: var(--accent);
}

/* Header */
.div-reg-container {
  width: 100%;
}

/* min-height holds the line while the title waits on widget.js to fill it. */
.registration-title {
  margin: 0;
  padding: 28px 20px 0;
  min-height: 1.2em;
  line-height: 1.2;
  text-align: center;
  color: var(--accent-text);
  font-size: 27px;
  font-weight: 400;
}

/* Form body */
.input-fields-container {
  padding: 0 28px 20px;
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
}

/*
 * Inputs and selects don't inherit the widget font by default, and their UA
 * weights differ — selects render heavier than input placeholders. Declaring
 * family and weight here keeps every field consistent once it holds a value.
 */
.input-group input,
.input-group select {
  box-sizing: border-box;
  width: 100%;
  height: 31px;
  padding: 0 22px;
  border: none;
  border-radius: 0;
  outline: none;
  background-color: var(--field-bg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.input-group input:focus-visible,
.input-group select:focus-visible {
  outline: 2px solid var(--button);
  outline-offset: -2px;
}

/* Selects pad their text by a few extra pixels; this lines it up with the
   inputs above. */
.input-group select {
  padding-left: 18px;
}

/* The browser's own disabled look washes the field out; the course select is
   only disabled while it loads, so it keeps the normal field colours. */
.input-group select:disabled {
  background-color: var(--field-bg);
  opacity: 1;
  cursor: not-allowed;
}

/* Real choices in the open dropdown keep the filled-value colour, so the
   placeholder rule below doesn't make them look like prompts. */
.input-group select option {
  font-weight: 400;
  color: var(--text);
}

/*
 * Placeholder text — and only placeholder text — sits bold, as in the ILNU
 * design, so an empty field reads as a label and a filled one as an answer.
 *
 * A select has no ::placeholder, so its unchosen state is matched instead. The
 * selects use different sentinels: the course select keeps a disabled
 * value="" option, while State/City hold their own sentinel as the value.
 */
.input-group input::placeholder {
  font-weight: 700;
  color: var(--placeholder);
  opacity: 1; /* Firefox dims ::placeholder by default. */
}

.input-group select:has(option[value=""]:checked),
.input-group select:has(option[value="State"]:checked),
.input-group select:has(option[value="City"]:checked) {
  font-weight: 700;
  color: var(--placeholder);
}

/*
 * Mobile OTP verification.
 *
 * Every one of these starts hidden and is shown by the widget only while
 * OTP_VERIFICATION.enabled is true.
 */
.otp-send-button,
.otp-resend-button {
  display: none;
  flex-shrink: 0;
  margin-left: 8px;
  padding: 0 12px;
  height: 31px;
  background-color: var(--button);
  color: var(--button-text);
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
}

.otp-send-button:hover,
.otp-resend-button:hover {
  background-color: var(--button-hover);
}

.otp-send-button:disabled,
.otp-resend-button:disabled {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

/* A green tick replacing the button once the number is verified. */
.otp-verified-tick {
  display: none;
  flex-shrink: 0;
  margin-left: 8px;
  color: var(--verified);
  font-size: 18px;
  line-height: 1;
}

.otp-row {
  display: none;
}

.otp-status {
  margin: 4px 0 0 2px;
  display: none;
  color: var(--text);
  font-size: 12px;
}

/* Consent checkbox — visually hidden input with a styled label */
.input-checkbox-container {
  position: relative;
  margin: 24px 0 14px;
}

input[type="checkbox"] {
  position: absolute;
  left: -999em;
  top: 15px;
  line-height: 2.1ex;
}

input[type="checkbox"] + label {
  position: relative;
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

input[type="checkbox"]:disabled + label {
  cursor: default;
}

input[type="checkbox"] + label::before {
  content: "";
  display: inline-block;
  vertical-align: -25%;
  height: 2ex;
  width: 2ex;
  background-color: transparent;
  border: 1.5px solid var(--checkbox);
  border-radius: 2px;
  margin-right: 0.5em;
}

input[type="checkbox"]:checked + label::after {
  content: "";
  position: absolute;
  width: 1.2ex;
  height: 0.4ex;
  top: 0.6ex;
  left: 0.3ex;
  background: transparent;
  border: 2px solid var(--checkbox);
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
}

.checkbox-color {
  color: var(--accent-text);
}

.checkbox-label-text {
  margin-left: 22px;
  margin-top: -17px;
}

/* Submit button */
.button-box {
  display: block;
  text-align: center;
}

.register-button,
.disable-button {
  position: relative;
  display: block;
  width: 100%;
  height: 48px;
  z-index: 1;
  margin-top: 4px;
  color: var(--button-text);
  background-color: var(--button);
  font-family: inherit;
  font-size: 22px;
  font-weight: bold;
  border: none;
  border-radius: 2px;
}

.register-button {
  cursor: pointer;
}

.register-button:hover {
  background-color: var(--button-hover);
}

/*
 * Not ready yet: a pale tint of the button blue. Grey — or the blue at reduced
 * opacity, which mixes with the yellow panel — reads as a muddy olive instead.
 */
.disable-button {
  background-color: var(--button-disabled);
  pointer-events: none;
}

/* Error messages */
.error-message {
  margin: 5px 0 0 2px;
  color: var(--error);
  font-size: 12px;
  font-weight: 700;
  display: none;
}

.api-response-error-div {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

#api-response-error-message,
#api-response-error-message-text {
  position: relative;
  z-index: 2;
  margin: 0 0 6px;
  text-align: center;
  color: var(--error);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  display: none;
}

#api-response-error-message-text {
  cursor: pointer;
}

/* Loading spinner overlay */
#spinner-container-div {
  position: absolute;
  display: none;
  z-index: 999;
  height: 100%;
  width: 100%;
  background-color: rgb(89, 85, 85);
  opacity: 75%;
}

.spin::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  height: 40px;
  width: 40px;
  margin-top: 14vh;
  z-index: 999;
  border: solid 5px #cfd0d1;
  border-bottom-color: var(--button);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  animation: 1.5s linear infinite spinner;
  animation-play-state: inherit;
}

@keyframes spinner {
  0% {
    transform: translate3d(-50%, -50%, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(-50%, -50%, 0) rotate(360deg);
  }
}

/* The spinner sits slightly higher on very tall/short viewports */
@media (max-width: 1240px) {
  .spin::before {
    margin-top: 15vh;
  }
}

@media (min-width: 1241px) {
  .spin::before {
    margin-top: 13vh;
  }
}

@media (max-width: 330px) {
  .error-message {
    font-size: 11px;
  }
}
