html,
body {
  background: linear-gradient(135deg, #f7fafc 0%, #e0f7fa 100%) !important;
  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}
body {
  background: #f7fafc;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  overflow-y: auto;
}
.container {
  background: #fff;
  padding: 2.2rem 2.2rem 2rem 2.2rem;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  border-radius: 18px;
  box-shadow:
    0 8px 40px 0 rgba(44, 62, 80, 0.13),
    0 2px 8px 0 rgba(44, 62, 80, 0.04);
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
}
@media (max-width: 500px) {
  .container {
    padding: 2rem;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}
.form-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.7rem;
}
.form-logo img {
  max-width: 180px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 8px #44d7b633);
}
h1 {
  background: none;
  color: #222;
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
form#saasForm {
  width: 100%;
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1.1rem;
}
@media (max-width: 700px) {
  form#saasForm {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
.form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  grid-column: span 1;
}
.form-group#full-width,
.success-message,
.api-error-message {
  grid-column: 1 / -1;
}
label {
  font-size: 0.97rem;
  font-weight: 500;
  color: #222;
  margin-bottom: 0.18rem;
}
input[type="text"],
input[type="email"],
input[type="tel"] {
  background: #f9fafb;
  border: 1.2px solid #cbd5e0;
  border-radius: 7px;
  font-size: 0.97rem;
  padding: 0.55rem 0.9rem;
  min-height: 36px;
  height: 36px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
  font-weight: 400;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
input.error {
  border-color: #e53e3e;
  background: #fff5f5;
}
input:focus {
  border-color: #0197bf;
  box-shadow: 0 0 0 1.5px #0197bf33;
}
.error-message {
  color: #e53e3e;
  font-size: 0.93rem;
  margin-top: 0.18rem;
  min-height: 1.1em;
  text-align: left;
}
.referral-status {
  font-size: 0.93rem;
  margin-top: 0.18rem;
  min-height: 1.1em;
  text-align: left;
}
.referral-status.valid {
  color: #38a169;
}
.referral-status.invalid {
  color: #e53e3e;
}
button#submitBtn {
  background: linear-gradient(90deg, #004aad 0%, #0197bf 100%);
  box-shadow: 0 2px 8px 0 rgba(30, 144, 255, 0.08);
  max-width: 300px;
  width: 100%;
  padding: 0.85rem 0;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 1.01rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
  margin-left: auto;
  margin-right: auto;
  grid-column: auto / span 2;
  font-family: "Inter", sans-serif;
}

@media (max-width: 700px) {
  button#submitBtn {
    grid-column: auto / span 1;
  }
}

button#submitBtn:disabled {
  background: #b2f5ea;
  cursor: not-allowed;
}

.api-success-message {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin: 0 auto;
  width: 100%;
  grid-column: 1 / -1;
  color: #004aad;
}
.success-message,
.api-error-message {
  font-size: 0.98rem;
  font-weight: 500;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin: 1rem 0 0 0;
  text-align: center;
  box-shadow: none;
  letter-spacing: 0.01em;
  animation: fadeIn 0.3s;
  display: block;
}

.api-error-message {
  color: #e53e3e;
  background: #fff5f5;
  border-radius: 6px;
  padding: 0.7rem 1.1rem;
  margin: 1.1rem 0 0 0;
  font-size: 1.04rem;
  font-weight: 600;
  text-align: center;
  box-shadow: none;
  letter-spacing: 0.01em;
  animation: fadeIn 0.3s;
  display: block;
  grid-column: 1 / -1;
}
.api-error-message.package-error {
  color: #fff;
  background: #e53e3e;
}

/* Loading spinner styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-spinner {
  border: 4px solid #e2e8f0;
  border-top: 4px solid #44d7b6;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Only apply these styles to .centered inside success.html and failure.html, not pay.html */
.centered.success-page,
.centered.failure-page {
  background: #fff;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
}
@media (max-width: 700px) {
  .centered.success-page,
  .centered.failure-page {
    border-radius: 0;
    border: none;
    box-shadow: none;
    max-width: 100vw;
    padding: 0;
  }
}
.success-icon,
.fail-icon {
  font-size: 3.2rem;
  margin-bottom: 1.2rem;
}
.success-message,
.fail-message {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
  text-align: center;
  color: #1a202c;
  background: none;
  box-shadow: none;
  padding: 0;
}
.next-steps,
.support {
  color: #2d3748;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.actions a,
.actions button {
  background: #44d7b6;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.7rem 1.3rem;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 0.5rem;
}
.actions a:hover,
.actions button:hover {
  background: #38a169;
}
/* Style the phone input to match other fields */
.form-group #phone,
.iti input {
  height: 36px;
  font-size: 0.97rem;
  border-radius: 7px;
  padding: 0 12px 0 44px; /* leave space for flag dropdown */
}
.iti {
  width: 100%;
}
.iti__flag-container {
  left: 12px;
}
.iti--allow-dropdown input,
.iti--separate-dial-code input {
  padding-left: 44px;
}
