/* =========================================================
   🧾 Reclaim Bharosa — Claim Form Styles (Email OTP Flow)
   ========================================================= */

/* ---------------------------------------------
   📍 Floating Sidebar & Wrapper Setup
--------------------------------------------- */
#claim-form {
  position: relative;
  align-self: stretch;
  height: auto;
  min-height: 100%;
}

#floatingForm {
  position: sticky;
  top: 7rem; /* below header */
  margin-top: 2rem;
  transition: transform 0.7s ease-in-out, opacity 0.7s ease-in-out;
  will-change: transform, opacity;
  z-index: 40;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.slide-show { opacity: 1 !important; transform: translateX(0) !important; }
.slide-hide { opacity: 0 !important; transform: translateX(150%) !important; }

/* ---------------------------------------------
   📋 Form Container
--------------------------------------------- */
#claimForm {
  background-color: #fff7ed; /* orange-50 */
  border: 1px solid #fed7aa; /* orange-200 */
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.1);
  transition: box-shadow 0.2s ease;
}
#claimForm:hover { box-shadow: 0 6px 18px rgba(249, 115, 22, 0.15); }

/* ---------------------------------------------
   🔳 Spacing between boxes (inputs/selects/textareas)
--------------------------------------------- */
#claimForm .rb-input,
#claimForm .rb-select,
#claimForm .rb-textarea {
  margin-bottom: 1rem; /* Adds clear gap between boxes */
}

/* ---------------------------------------------
   🧠 Inputs, Selects & Textareas
--------------------------------------------- */
#claimForm input,
#claimForm select,
#claimForm textarea {
  width: 100%;
  border: 1px solid #fdba74; /* orange-300 */
  border-radius: 0.5rem;
  background-color: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  color: #374151; /* gray-700 */
  transition: all 0.2s ease;
  font-family: inherit;
}
#claimForm input:focus,
#claimForm select:focus,
#claimForm textarea:focus {
  outline: none;
  border-color: #fb923c; /* orange-400 */
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.25);
}
#claimForm ::placeholder { color: #9ca3af; font-style: italic; }

/* ---------------------------------------------
   ⬇️ Custom dropdown arrow for selects
   (FIXED: remove escaped quotes in data-URI)
--------------------------------------------- */
#claimForm .rb-select {
  position: relative;
  padding-right: 2.25rem; /* space for arrow */
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px 14px;

  /* default grey arrow */
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'>\
    <path d='M5 8l5 5 5-5' stroke='%23737484' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
  </svg>");
}
#claimForm .rb-select:focus {
  /* orange arrow on focus */
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'>\
    <path d='M5 8l5 5 5-5' stroke='%23f97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
  </svg>");
}

/* Screen-reader-only labels (accessible placeholders pattern) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------------------------------------------
   🧭 Verification Method (Radio Buttons)
--------------------------------------------- */
.verification-group {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 2rem; flex-wrap: nowrap; margin-top: 0.25rem;
}
.verification-group label {
  display: inline-flex; align-items: center; gap: 0.4rem; line-height: 1.2; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.verification-group input[type="radio"] {
  position: relative; top: 0.05rem; vertical-align: middle; accent-color: #f97316;
  transform: scale(1.05);
  appearance: auto; -webkit-appearance: auto;
}
.verification-group span { font-size: 0.95rem; color: #7c2d12; white-space: nowrap; }

@media (max-width: 400px) {
  .verification-group { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}

/* ---------------------------------------------
   ✅ Submit Button
--------------------------------------------- */
#submitBtn {
  width: 100%;
  background-image: linear-gradient(to right, #fb923c, #f97316);
  color: white; padding: 0.75rem; border-radius: 0.75rem;
  font-weight: 600; font-size: 1rem;
  box-shadow: 0 3px 8px rgba(249, 115, 22, 0.3);
  transition: all 0.25s ease;
}
#submitBtn:hover { background-image: linear-gradient(to right, #f97316, #ea580c); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4); }
#submitBtn[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(35%); }

/* ---------------------------------------------
   📱 Responsive Layout
--------------------------------------------- */
@media (max-width: 768px) {
  #floatingForm { position: static; margin-top: 1rem; box-shadow: none; border-radius: 0.75rem; }
  #claimForm { padding: 1rem; }
}

/* ---------------------------------------------
   🟢 Status Messages
--------------------------------------------- */
#statusMessage { font-weight: 600; margin-top: 1rem; text-align: center; }
#statusMessage.text-green-600 { color: #16a34a; }
#statusMessage.text-red-600 { color: #dc2626; }

/* ---------------------------------------------
   🧩 Layout Support for Sticky Scroll
--------------------------------------------- */
@media (min-width: 1024px) {
  #claim-form { min-height: 1200px; }
}

/* ---------------------------------------------
   ✉️ Modal (OTP & Success)
--------------------------------------------- */
.rb-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.3s ease;
}

.rb-modal[hidden] {
  display: none !important;
  opacity: 0;
}

.rb-modal__dialog {
  position: relative;
  background: #fff;
  color: #111827;
  border-radius: 1rem;
  padding: 1.5rem 1.75rem 1.25rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: rbFadeIn 0.25s ease-out;
}

@keyframes rbFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.rb-modal__text { font-size: 1rem; color: #334155; margin: 0.75rem 0 1rem; }

.rb-modal__row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.rb-btn-primary,
.rb-btn-ghost,
.rb-btn-link {
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 0.65rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.rb-btn-primary {
  background: linear-gradient(to right, #fb923c, #f97316);
  color: #fff;
}

.rb-btn-ghost {
  background: #fff7ed;
  color: #7c2d12;
  border: 1px solid #fdba74;
}

.rb-btn-link {
  background: none;
  color: #2563eb;
  text-decoration: underline;
  font-size: 0.9rem;
}

.rb-status { font-size: 0.9rem; font-weight: 600; margin-top: 0.5rem; }

/* =========================================================
   ✉️ OTP Input Field Fix
   ========================================================= */
.rb-otp-input {
  width: 100%;
  max-width: 220px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.3rem;
  color: #111827;
  background: #fff;
  border: 1px solid #fdba74; /* orange-300 */
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  margin: 0.5rem auto 1rem;
  display: block;
  box-shadow: 0 1px 3px rgba(249, 115, 22, 0.15);
  transition: all 0.2s ease;
}
.rb-otp-input:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.25);
}
.rb-modal__dialog .rb-otp-input::-webkit-outer-spin-button,
.rb-modal__dialog .rb-otp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rb-modal__dialog .rb-otp-input[type="number"] { -moz-appearance: textfield; }

/* =========================================================
   🎨 Cross-Browser Form Control Appearance Fixes
   ========================================================= */
#claimForm input,
#claimForm select,
#claimForm textarea,
.rb-otp-input {
  -webkit-appearance: none; /* Safari / iOS */
  -moz-appearance: none;    /* Firefox */
  appearance: none;         /* Standard */
}

#claimForm input[type="radio"] {
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
}

#claimForm input[type="number"]::-webkit-inner-spin-button,
#claimForm input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#claimForm input[type="number"] { -moz-appearance: textfield; }
