/* ──────────────────────────────── */
/* 🌐 GLOBAL RESETS */
/* ──────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
  background: #f4f6f8;
  color: #222;
  line-height: 1.6;
}

/* ──────────────────────────────── */
/* 🧱 FORM WRAPPER */
/* ──────────────────────────────── */
.form-wrapper {
  background: #fff;
  width: 90%;
  max-width: 900px;
  margin: 50px auto;
  padding: 40px 50px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.7s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────── */
/* 🏷️ HEADINGS */
/* ──────────────────────────────── */
.intro h1, .intro h2 {
  font-size: 30px;
  margin-bottom: 10px;
}

.intro p {
  color: #555;
  margin-bottom: 30px;
}

.referralForm h3 {
  font-size: 1.2rem;
  color: #333;
  border-left: 4px solid #0046ff; /* BLUE accent */
  padding-left: 8px;
  margin-bottom: 10px;
  box-shadow: -1px 0 2px rgba(0, 70, 255, 0.2);
}

/* ──────────────────────────────── */
/* 🧩 GRID SYSTEM */
/* ──────────────────────────────── */
.grid {
  display: grid;
  width: 100%;
  align-items: start;
}

/* Default 2-column layout */
.grid.two-col,
.two-col {
  grid-template-columns: 48% 48%;
  column-gap: 4%;
}

/* Three-column layout (Company, Name, Email) */
.grid.three-col {
  grid-template-columns: 32% 32% 32%;
  column-gap: 2%;
}

/* Prevent Safari or theme overrides */
.grid > .field,
.grid.two-col > .field,
.grid.three-col > .field {
  min-width: 0;
}

/* Force full-width phone field */
.field.phone-field {
  grid-column: 1 / -1;
  width: 100%;
  display: block;
}

/* Force City to start new line after phone */
.field.phone-field + .field {
  grid-column: 1 / 2;
  clear: both;
  margin-top: 10px;
}

/* ──────────────────────────────── */
/* 🧾 FORM FIELDS */
/* ──────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 5px;
}

.required {
  color: #0046ff;
  font-weight: bold;
  margin-left: 3px;
}

input,
textarea,
select {
  border: 1px solid #ccc;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 15px;
  transition: 0.2s ease;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #0046ff;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 70, 255, 0.25);
}

/* ──────────────────────────────── */
/* 📞 PHONE GROUP */
/* ──────────────────────────────── */
.phone-group {
  display: flex;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
}

/* Country code select */
.phone-group select {
  flex: 0 0 150px;
  min-width: 130px;
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 6px 0 0 6px;
  background-color: #fff;
  font-size: 0.95rem;
}

/* Phone number input */
.phone-group input {
  flex: 1;
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}

/* Fallback for editors that flag 'gap' */
.phone-group > * + * {
  margin-left: 10px;
}

/* ──────────────────────────────── */
/* 💠 DIVIDERS */
/* ──────────────────────────────── */
hr.divider {
  display: block;
  height: 4px;
  width: 100%;
  border: none;
  margin: 25px 0 15px;
  border-radius: 2px;
  background: linear-gradient(90deg, #0046ff 0%, #00bfff 100%);
}

/* ──────────────────────────────── */
/* 🟦 BUTTONS & SUCCESS MESSAGE */
/* ──────────────────────────────── */
.submit-area {
  text-align: center;
  margin-top: 30px;
}

button {
  background: #0046ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px 28px;
  font-size: 17px;
  cursor: pointer;
  transition: 0.3s ease;
}

button:hover {
  background: #0030cc;
}

.success {
  display: none;
  color: #0046ff;
  background: #e8f0ff;
  border: 1px solid #aac8ff;
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 20px;
  font-weight: 500;
  line-height: 1.5;
  animation: fadeIn 0.4s ease-in;
}

.error {
  display: none;
  color: #0046ff;
  background: #FF0000;
  border: 1px solid #aac8ff;
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 20px;
  font-weight: 500;
  line-height: 1.5;
  animation: fadeIn 0.4s ease-in;
}


/* ──────────────────────────────── */
/* 📱 RESPONSIVE DESIGN */
/* ──────────────────────────────── */
@media screen and (max-width: 992px) {
  .grid.two-col,
  .grid.three-col,
  .two-col {
    grid-template-columns: 100%;
    column-gap: 0;
  }

  .field.phone-field {
    grid-column: auto;
  }

  .phone-group {
    flex-direction: column;
    align-items: stretch;
  }

  .phone-group select,
  .phone-group input {
    width: 100%;
    height: 42px;
    border-radius: 6px;
    margin-left: 0;
  }

  button {
    width: 100%;
    font-size: 16px;
    padding: 12px;
  }

  .form-wrapper {
    width: 95%;
    padding: 25px 20px;
  }
}

/* ──────────────────────────────── */
/* 📱 EXTRA SMALL MOBILE */
/* ──────────────────────────────── */
@media screen and (max-width: 480px) {
  .form-wrapper {
    width: 95%;
    padding: 20px 15px;
  }

  .intro h1 {
    font-size: 22px;
  }

  textarea {
    min-height: 100px;
  }

  .phone-group {
    flex-direction: column;
  }

  .phone-group select,
  .phone-group input {
    width: 100%;
  }
}
