/**
 * IIMU Lead Form: styles for the "Welcome!" lead-capture card
 * (templates/form.php).
 *
 * Adapted from the admissions portal's React App.css - only the rules the
 * card uses - plus rules for the card shell, phone field, tooltip, toast and
 * success pop-up, which were inline styles or MUI components there.
 */

/* WordPress: the standalone page's global `*` and `body` rules are scoped
   to the shortcode wrapper so they don't restyle the rest of the site. */
.iimu-lead-form,
.iimu-lead-form *,
.iimu-lead-form *::before,
.iimu-lead-form *::after {
  box-sizing: border-box;
}

.iimu-lead-form {
  display: flex;
  justify-content: center;
  width: 100%;
  font-family: 'Nunito', sans-serif;
}

/* Some themes set `display` on elements that script.js hides via the
   `hidden` attribute - make sure `hidden` always wins inside the form. */
.iimu-lead-form [hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------- */
/* Card shell                                                              */
/* ---------------------------------------------------------------------- */

.lead-form-card {
  width: 100%;
  /* Matches the source's default (non-1.5x-zoom) form-wrapper width. */
  max-width: 500px;
  background: linear-gradient(rgb(255, 255, 255) 0%, rgb(255, 249, 196) 100%);
  padding: 2rem;
  /* Source's containerStyle has no border-radius - sharp corners. */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
  .lead-form-card {
    padding: 1.5rem;
  }
}

.lead-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.lead-form-title {
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 0 0.2rem;
  color: rgba(6, 25, 56, 1);
}

.lead-form-subtitle {
  font-weight: 400;
  font-size: 1rem;
  color: #000;
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Form layout                                                            */
/* ---------------------------------------------------------------------- */

/* A class rather than #leadForm: a page can show the form more than once,
   and only the first copy keeps the plain IDs. */
.iimu-lead-form .lead-form-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  /* Source's .form-group class carries this (only `gap` gets overridden
     inline) - rows with no explicit width of their own (the two checkbox
     rows) shrink to their content and left-align instead of stretching
     full-width, which is what let `justify-content: center` visibly float
     the short "International Applicant" row toward the middle. */
  align-items: start;
}

.address-field {
  display: flex;
  gap: 12px;
  width: 100%;
}

.address-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.phone-field {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 7px;
}

.dial-code-select {
  flex: 0 0 118px;
  margin-bottom: 0 !important;
  padding-left: 8px !important;
  padding-right: 22px !important;
}

.phone-number-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0 !important;
}

/* ---------------------------------------------------------------------- */
/* Inputs / selects (App.css: .input-field, .select-custom)               */
/* ---------------------------------------------------------------------- */

.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fcfcfc;
  height: 40px;
  margin-bottom: 6px;
  font-family: 'Nunito', sans-serif;
}

.input-field::placeholder {
  color: #757575;
  opacity: 1;
}

.input-field:disabled,
.select-custom:disabled {
  background-color: #f5f5f5 !important;
  cursor: not-allowed !important;
}

.select-custom {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fcfcfc;
  background-image: url('data:image/svg+xml;utf8,<svg fill="rgba(116,116,116,1)" height="30" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  color: rgba(116, 116, 116, 1);
  border: 1px solid #ccc;
  height: 40px;
  border-radius: 6px;
  width: 100%;
  padding: 0px 30px 0px 12px;
  margin-bottom: 4.5px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
}

.select-custom.has-value {
  color: #000;
}

.error-text {
  color: red;
  font-size: 13.5px;
  margin-bottom: 4px;
}

/* ---------------------------------------------------------------------- */
/* "No states available" tooltip (App.css inline style in GlobalLeadForm) */
/* ---------------------------------------------------------------------- */

.info-tooltip {
  position: absolute;
  top: 45px;
  left: 0px;
  background: #fefefe;
  border: 1px solid #ccc;
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 12px;
  color: #444;
  z-index: 10;
}

.info-tooltip-arrow {
  position: absolute;
  top: -6px;
  left: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #ccc;
}

/* ---------------------------------------------------------------------- */
/* Checkboxes (custom-checkbox-input pattern from GlobalLeadForm)         */
/* ---------------------------------------------------------------------- */

.check-row {
  margin: 0.2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.visually-hidden-checkbox {
  display: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-label-align-start {
  align-items: flex-start;
}

.checkbox-box {
  flex-shrink: 0;
  border: 2px solid #ccc;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  transition: all 0.2s ease;
}

/* Source sizes these two checkboxes inconsistently (12x12 vs a stretched
   20x13 rectangle) - both classes are kept so the HTML/JS distinction
   stays meaningful, but they're unified to the same proper square here. */
.checkbox-box-sm,
.checkbox-box-lg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.checkbox-box::after {
  content: '';
  display: none;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

input:checked + .checkbox-box {
  background-color: rgba(181, 167, 47, 1);
  border-color: rgba(181, 167, 47, 1);
}

input:checked + .checkbox-box::after {
  display: block;
}

.checkbox-text {
  margin-left: 0.5rem;
  font-size: 13.5px;
}

/* ---------------------------------------------------------------------- */
/* reCAPTCHA + submit                                                     */
/* ---------------------------------------------------------------------- */

.captcha-container {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-top: 10px;
  margin-bottom: 6px;
}

.register-button {
  margin-top: 10px;
  width: 100%;
  background: linear-gradient(270deg, #ffeb42 -495%, #47712b 104.5%);
  color: white;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Nunito', sans-serif;
}

.register-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.signin-row {
  font-size: 14px;
  text-align: center;
  width: 100%;
  padding-top: 0.5rem;
}

.signin-row a {
  color: rgba(65, 103, 39, 1);
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

.signin-row a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Toast (stand-in for the portal's notistack snackbar)                   */
/* ---------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 0);
  min-width: 280px;
  max-width: min(90vw, 420px);
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.toast.toast-error {
  background: #d32f2f;
}

.toast.toast-success {
  background: #2e7d32;
}

/* ---------------------------------------------------------------------- */
/* Success modal - shown in place of the redirect-to-success-page flow    */
/* ---------------------------------------------------------------------- */

.success-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 11000;
}

.success-modal {
  position: relative;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 2rem 1.75rem 1.75rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.success-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 6px;
}

.success-modal-close:hover {
  color: #333;
}

.success-modal-icon {
  color: rgba(65, 103, 39, 1);
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
}

.success-modal-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: rgba(6, 25, 56, 1);
}

.success-modal-text {
  margin: 0 0 20px;
  font-size: 14px;
  color: #585a64;
  line-height: 1.5;
}

.success-modal-button {
  background: linear-gradient(270deg, #ffeb42 -495%, #47712b 104.5%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 32px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}
