/* --- FOA card: responsive + safe gutters on mobile --- */
#foa-root {
  box-sizing: border-box;

  /* responsive width: full viewport minus horizontal gutters (12px each side) */
  width: calc(100% - 24px);

  /* but never wider than this on desktop/tablet */
  max-width: 420px;

  /* center horizontally, and give vertical spacing */
  margin: 18px auto;

  /* internal padding */
  padding: 20px;

  background: #ffffff;
  border: 2px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: 'Montserrat', sans-serif;
}

/* Test Mode highlight (stronger green glow) */
#foa-root.foa-test-mode {
  border-color: #28a745;
  box-shadow: 0 6px 22px rgba(40,167,69,0.65);
}

/* Inputs and layout kept responsive */
.foa-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* Country code fixed width, phone uses remaining space */
.foa-country-code {
  flex: 0 0 20%;
  min-width: 56px;
  text-align: center;
  background: #f6f8fb;
  border: 1px solid #d6dce6;
  border-radius: 6px;
  padding: 10px 6px;
  font-size: 18px;
  box-sizing: border-box;
}

/* Phone input flexes and centers content */
#foa-phone {
  flex: 1 1 0;
  width: 0;               /* allow flex to control width */
  border: 1px solid #d6dce6;
  border-radius: 6px;
  padding: 10px;
  font-size: 18px;
  text-align: center;
  box-sizing: border-box;
}

/* OTP and email full width within card */
#foa-otp, #foa-email {
  width: 100%;
  padding: 10px;
  font-size: 18px;
  border: 1px solid #d6dce6;
  border-radius: 6px;
  margin-bottom: 10px;
  text-align: center;
  box-sizing: border-box;
}

/* Buttons */
#foa-send-otp, #foa-verify-otp, #foa-save-email {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #3498db;
  color: #fff;
  margin-bottom: 10px;
  transition: background 0.18s, opacity 0.18s;
}

/* Hover */
#foa-send-otp:hover, #foa-verify-otp:hover, #foa-save-email:hover {
  background: #2980b9;
}

/* Disabled button style (grayed out) */
#foa-save-email[disabled],
#foa-send-otp[disabled],
#foa-verify-otp[disabled] {
  background: #bfcbdc;
  cursor: not-allowed;
  opacity: 0.9;
}

/* Message / status */
#foa-message {
  margin-top: 10px;
  font-size: 14px;
  color: #d64545;
  min-height: 18px;
}

/* Status board style (if enabled) */
#foa-status-board {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 13px;
  margin-top: 14px;
  padding: 10px;
  border: 1px dashed #ccc;
  background: #fbfbfb;
  color: #222;
  height: 200px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Small screens tweak */
@media (max-width: 420px) {
  /* ensure country code doesn't shrink too small */
  .foa-country-code { min-width: 48px; font-size: 16px; padding: 8px 6px; }
  #foa-phone, #foa-otp, #foa-email { font-size: 16px; padding: 10px; }
  #foa-root { padding: 16px; margin: 14px auto; }
}

/* Larger screens tweak for nicer placement */
@media (min-width: 900px) {
  #foa-root { margin: 32px auto; }
}
