/* ===========================
   Agri Donation - Clean UI (max-width: 500px)
   =========================== */

   :root{
     --agri-blue: #DC5410;
     --agri-blue-dark: #5E4E4B;
     --agri-text: #2F2A28;
     --agri-muted: #806A66;
     --agri-border: #E6E1DE;
     --agri-bg: #FFFFFF;
     --agri-soft: #F4F1EF;
   }

.agri-donation-wrapper{
  max-width: 500px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--agri-text);
}

.agri-donation-wrapper *{ box-sizing: border-box; }

.agri-form-card{
  background: var(--agri-bg);
  border: 1px solid var(--agri-border);
  border-radius: 14px;
  padding: 18px 16px;
}

/* Stepper */
.agri-stepper{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--agri-muted);
  margin: 0 0 14px;
}
.agri-stepper .agri-step.is-active{
  color: var(--agri-text);
  font-weight: 700;
}
.agri-stepper .agri-step-sep{ color: #9ca3af; }

/* Sections */
.agri-section{ margin: 0 0 18px; }

.agri-section-title{
  color: var(--agri-blue-dark);
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 10px;
}

.agri-required{ color: #ef4444; font-weight: 800; }

/* Tabs - segmented */
.agri-tabs-segmented{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  background: #d1d5db;
}

.agri-tabs-segmented .agri-tab-btn{
  border: 0;
  background: #d1d5db;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 24px 10px;
  font-size: clamp(15px, 3.8vw, 17px);
}

.agri-tabs-segmented .agri-tab-btn.active{
  background: var(--agri-blue);
}

/* Amount list rows */
.agri-amount-list{
  border-top: 1px solid var(--agri-border);
}

.agri-amount-row{
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--agri-border);
  padding: 14px 10px;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.agri-amount-left{ padding-left: 2px; }
.agri-amount-currency{
  font-size: 12px;
  font-weight: 800;
  color: var(--agri-muted);
  letter-spacing: 0.2px;
}

.agri-amount-number{
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1;
  font-weight: 500;
  color: var(--agri-text);
}

.agri-amount-right{
  font-size: 18px;
  font-weight: 600;
  color: var(--agri-text);
  text-align: right;
}

.agri-amount-row.selected .agri-amount-number,
.agri-amount-row.selected .agri-amount-right{
  color: var(--agri-blue);
  font-weight: 900;
}

/* Custom amount row */
.agri-custom-amount{
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px 10px 10px;
}

.agri-custom-left{
  font-size: 16px;
  font-weight: 900;
  color: var(--agri-text);
}

.agri-custom-input-wrap{
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--agri-soft);
  border-radius: 999px;
  padding: 10px 12px;
}

.agri-custom-placeholder{
  color: #6b7280;
  font-weight: 900;
}

.agri-custom-amount input[type="number"]{
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-weight: 900;
  width: 100%;
  min-width: 120px;
  color: var(--agri-text);
}

.agri-custom-amount.selected .agri-custom-input-wrap{
  outline: 2px solid rgba(37, 99, 235, 0.35);
}

.error-msg{
  grid-column: 1 / -1;
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.hidden{ display: none !important; }

/* ===== Payment methods (ONE ROW) ===== */
.agri-payment-methods{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;          /* 不換行 */
  gap: 12px;
  overflow-x: auto;           /* 擠不下時水平滑動，不裁切文字 */
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.agri-payment-methods::-webkit-scrollbar{ height: 6px; }
.agri-payment-methods::-webkit-scrollbar-thumb{ background: rgba(17,24,39,0.18); border-radius: 999px; }

/* Tools（可換行，因為 ATM 可能有兩個工具） */
.agri-payment-tools{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.agri-radio{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(13px, 3.2vw, 15px); /* 小螢幕自動縮字 */
  font-weight: 900;
  color: var(--agri-text);
  cursor: pointer;
  white-space: nowrap;        /* 文字不換行 */
  line-height: 1;             /* 避免某些瀏覽器看起來下沉 */
  margin: 0;                  /* 覆蓋主題常見的 label margin: 0 0 .5em 0; */
  padding: 0;
}

.agri-radio input[type="radio"]{
  width: 16px;
  height: 16px;
  margin: 0;                 /* Chrome/Safari 預設 margin 會造成垂直位移 */
  flex: 0 0 auto;
  accent-color: var(--agri-blue);
}

.agri-radio-text{
  display: inline-flex;
  align-items: center;
  line-height: 1;            /* 中英混排時避免基準線視覺偏移 */
}


.agri-radio input[type="radio"]:checked + .agri-radio-text{
  color: var(--agri-blue);
}

.agri-radio.is-disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

.agri-help-text{
  color: var(--agri-muted);
  font-size: 13px;
  margin: 0 0 10px;
}

/* Submit */
.agri-submit-btn{
  width: 100%;
  border-radius: 12px;
  background: var(--agri-blue);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  padding: 14px 14px;
  border: 0;
  cursor: pointer;
}

.agri-submit-btn:hover{ filter: brightness(0.97); }

.agri-submit-btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive fine-tune */
@media (max-width: 420px){
  .agri-form-card{ padding: 16px 12px; }
}
