/* JS Institute of Design — enquiry widget styles */

html,
body {
  padding: 0;
  margin: 2px;
  height: auto;
}

#box {
  width: 100%;
  height: auto;
  margin: auto;
  color: white;
  font-family: "Roboto", sans-serif;
  font-size: 10px;
}

/* Animated gradient border around the whole widget */
.full-container {
  --borderWidth: 4px;
  position: relative;
  background: white;
  border-radius: 8px;
}

.full-container::after {
  content: "";
  position: absolute;
  top: calc(-1 * var(--borderWidth));
  left: calc(-1 * var(--borderWidth));
  height: calc(100% + var(--borderWidth) * 2);
  width: calc(100% + var(--borderWidth) * 2);
  background: linear-gradient(
    60deg,
    #f79533,
    #f0ac24,
    #5073b8,
    #5073b8,
    #7196e0,
    #1098ad,
    #f79533,
    #f0ac24
  );
  background-size: 300% 300%;
  border-radius: calc(2 * var(--borderWidth));
  z-index: -1;
  animation: animatedgradient 3s ease alternate infinite;
}

@keyframes animatedgradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Header */
.div-reg-container {
  position: relative;
  width: 100%;
  background-color: white;
  border-radius: 8px 8px 0 0;
}

.registration-title {
  margin: 0;
  padding: 10px 0;
  text-align: center;
  background-color: #ffff55;
  color: black;
  border-radius: 6px 6px 8px 8px;
  font-size: 18px;
}

/* Form body */
.authentication-form {
  background-color: white;
  border-radius: 0 0 8px 8px;
}

.input-fields-container {
  padding: 10px 20px 0;
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
}

/*
 * Inputs and selects don't inherit the widget font by default, and their UA
 * weights differ — selects rendered heavier than input placeholders, so the
 * State/City/Programme row looked bolder than name/email/mobile. Declaring
 * family and weight here keeps every field consistent once it holds a value.
 */
.input-group input,
.input-group select {
  width: 100%;
  border: none;
  outline: none;
  border-bottom: 1px solid #bfbbbb;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: #333;
}

/* Real choices in the open dropdown keep the filled-value colour, so the grey
   placeholder rule above doesn't make them look disabled. */
.input-group select option {
  font-weight: 400;
  color: #333;
}

/*
 * Placeholder text — and only placeholder text — sits lighter and greyer, so
 * an empty field reads as a prompt and a filled one reads as an answer.
 *
 * The grey is set on both, not left to the browser: only ::placeholder gets a
 * UA grey, so an unstyled select would show its prompt in near-black next to
 * the inputs' grey. Both are pinned to the same value to stay in step.
 *
 * A select has no ::placeholder, so its unchosen state is matched instead. The
 * two selects use different sentinels: the course select keeps a disabled
 * value="" option, while State/City hold their own label as the value.
 */
.input-group input::placeholder {
  font-weight: 300;
  color: #757575;
  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: 300;
  color: #757575;
}

.country-code-wrapper {
  width: 70px;
}

.course-category-type {
  width: 40px !important;
}

/*
 * Per-course variants hide both course selects and show this instead. The
 * label carries the same underline as a real field so the row keeps the
 * form's rhythm rather than collapsing to a gap.
 */
.fixed-course-label {
  display: none;
  width: 100%;
  padding-bottom: 1px;
  border-bottom: 1px solid #bfbbbb;
  font-size: 15px;
  font-weight: 400;
  color: #333;
}

.input-group.fixed-course .fixed-course-label {
  display: block;
}

.flex-div-container {
  display: flex;
}

.half-width-container {
  width: 50%;
}

#city-input-field {
  margin-left: 15px;
}

/* Hide number-input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Consent checkbox — visually hidden input with a styled label */
.input-checkbox-container {
  position: relative;
  margin: 15px 0;
}

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;
  cursor: pointer;
}

input[type="checkbox"] + label::before {
  content: "";
  display: inline-block;
  vertical-align: -25%;
  height: 2ex;
  width: 2ex;
  background-color: white;
  border: 1px solid #cb282d;
  border-radius: 4px;
  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: 3px solid #cb282d;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
}

.checkbox-color {
  color: #929292;
}

.checkbox-color span {
  color: #929292 !important;
  font-size: 11px;
}

.checkbox-label-text {
  margin-left: 20px;
  margin-top: -16px;
}

/* Submit button */
.button-box {
  display: block;
  text-align: center;
}

.register-button,
.disable-button {
  position: relative;
  display: inline-block;
  z-index: 1;
  padding: 8px 18px;
  margin-top: 5px;
  color: black;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  text-transform: uppercase;
}

.register-button {
  background-color: #ffff55;
  cursor: pointer;
}

/*
 * A deeper shade of the same yellow. Lightness alone barely reads on a
 * fully-saturated hue, so this drops saturation a little too.
 */
.register-button:hover {
  background-color: #eded1d;
}

/*
 * The disabled state stays grey: on a yellow-on-yellow form the only thing
 * separating "ready to submit" from "not yet" is this colour change.
 */
.disable-button {
  background-color: rgb(203, 201, 201);
  color: rgb(90, 88, 88);
  pointer-events: none;
}

/* Error messages */
.error-message {
  margin: 5px 0 0 5px;
  color: rgb(173, 51, 51);
  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;
  text-align: center;
  color: #ad3333;
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-weight: 400;
  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%;
  border-radius: 8px;
}

.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: #1c87c9;
  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;
  }
}
