/* ─── ثبت نام اینترنت فیبرنوری + فرم اطلاعات خریدار مودم ─────────────── */
.fiber-entry{
  background:linear-gradient(135deg,#193e61 0%,#1f5f87 100%);
}
.fiber-entry:hover{
  box-shadow:0 18px 38px rgba(25,62,97,.22);
}
.fiber-placeholder{
  margin-top:16px;
  padding:20px;
  border-radius:22px;
  background:var(--panel-soft);
  border:1px dashed var(--line-strong);
  display:flex;
  align-items:flex-start;
  gap:14px;
  color:var(--text-soft);
}
.fiber-placeholder .mi{
  font-size:30px;
  color:var(--accent);
  flex-shrink:0;
}
.fiber-placeholder strong{
  display:block;
  color:var(--text);
  font-size:15px;
  font-weight:900;
  margin-bottom:6px;
}
.fiber-placeholder p{
  margin:0;
  font-size:12px;
  line-height:2;
}
.modem-customer-section{
  margin-top:16px;
  padding:18px;
  border:1px solid #e9dfd3;
  border-radius:22px;
  background:linear-gradient(180deg,#fff 0%,#fcfaf7 100%);
  box-shadow:var(--shadow);
}
.modem-customer-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.form-field{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.form-field.full{
  grid-column:1/-1;
}
.form-inp{
  width:100%;
  min-height:46px;
  border:1.5px solid var(--line-strong);
  border-radius:15px;
  background:#fff;
  color:var(--text);
  font-size:14px;
  font-weight:700;
  padding:0 14px;
  outline:none;
  transition:border-color .2s,box-shadow .2s;
  box-sizing:border-box;
}
.form-inp:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(31,59,91,.08);
}
.form-inp.invalid{
  border-color:#efb1b1;
}
.form-inp.valid{
  border-color:#b9dfcf;
}
.form-textarea{
  min-height:92px;
  padding:12px 14px;
  resize:vertical;
  line-height:2;
  font-family:'Vazirmatn',sans-serif;
}
body.modem-mode #vFiberRegister{
  width:100%;
}
@media (max-width:860px){
  .modem-customer-grid{grid-template-columns:1fr}
  .modem-customer-section{padding:15px 13px}
}

/* ─── چیدمان دو ستونه پیش‌فاکتور مودم و فرم خریدار ─────────────── */
.modem-checkout-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,.95fr);
  gap:14px;
  align-items:start;
  margin-top:8px;
}
.modem-checkout-invoice,
.modem-checkout-form{
  min-width:0;
}
.modem-checkout-invoice .invoice-box{
  margin-top:0;
}
.modem-checkout-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.modem-checkout-form .modem-customer-section{
  margin-top:0;
}
.modem-checkout-form .btn-p{
  width:100%;
}

/* ─── FIX: چیدمان قطعی دو ستونه پیش‌فاکتور و فرم مودم ─────────────── */
.modem-invoice-section .modem-checkout-grid{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:flex-start;
  gap:16px;
  width:100%;
  margin-top:8px;
  direction:rtl;
}

.modem-invoice-section .modem-checkout-invoice,
.modem-invoice-section .modem-checkout-form{
  min-width:0;
  flex:1 1 0;
}

.modem-invoice-section .modem-checkout-invoice{
  order:1;
}

.modem-invoice-section .modem-checkout-form{
  order:2;
}

.modem-invoice-section .modem-customer-section{
  margin-top:0;
}

.modem-invoice-section .btn-p{
  width:100%;
}

@media (max-width:760px){
  .modem-invoice-section .modem-checkout-grid{
    flex-direction:column;
  }

  .modem-invoice-section .modem-checkout-invoice,
  .modem-invoice-section .modem-checkout-form{
    width:100%;
    flex:none;
  }
}
/* ─── مودم: پیش‌فاکتور سمت راست، فرم سمت چپ ───────────────────── */

#modemInvoiceSection .modem-checkout-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,420px);
  gap:16px;
  align-items:start;
  width:100%;
  direction:rtl;
}

#modemInvoiceSection .modem-checkout-invoice{
  min-width:0;
}

#modemInvoiceSection .modem-checkout-form{
  min-width:0;
}

#modemInvoiceSection .modem-customer-card{
  background:#fff;
  border:1px solid #e9dfd3;
  border-radius:18px;
  padding:16px;
  box-shadow:var(--shadow);
}

#modemInvoiceSection .modem-customer-title{
  margin-bottom:12px;
}

#modemInvoiceSection .modem-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

#modemInvoiceSection .modem-form-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

#modemInvoiceSection .modem-form-field-full{
  grid-column:1 / -1;
}

#modemInvoiceSection .modem-form-field label{
  font-size:11px;
  font-weight:800;
  color:var(--text-soft);
}

#modemInvoiceSection .modem-form-field input,
#modemInvoiceSection .modem-form-field textarea{
  width:100%;
  border:1.5px solid var(--line-strong);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-family:'Vazirmatn',sans-serif;
  font-size:13px;
  font-weight:700;
  outline:none;
  box-sizing:border-box;
  transition:border-color .18s,box-shadow .18s;
}

#modemInvoiceSection .modem-form-field input{
  height:42px;
  padding:0 12px;
}

#modemInvoiceSection .modem-form-field textarea{
  resize:vertical;
  min-height:86px;
  padding:10px 12px;
  line-height:1.9;
}

#modemInvoiceSection .modem-form-field input:focus,
#modemInvoiceSection .modem-form-field textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(31,59,91,.08);
}

#modemInvoiceSection .modem-customer-card .btn-p{
  margin-top:12px;
  width:100%;
}

@media (max-width:900px){
  #modemInvoiceSection .modem-checkout-grid{
    grid-template-columns:1fr;
  }
}
#modemInvoiceSection .modem-form-field input.invalid,
#modemInvoiceSection .modem-form-field textarea.invalid{
  border-color:var(--danger);
  box-shadow:0 0 0 4px rgba(217,64,64,.08);
}

#modemInvoiceSection .modem-form-field input.valid,
#modemInvoiceSection .modem-form-field textarea.valid{
  border-color:#b9dfcf;
}


/* ─── ثبت نام اینترنت فیبرنوری ───────────────────────────────────── */

.fiber-entry{
  background:linear-gradient(135deg,#163655 0%,#1f5a86 100%);
}

.fiber-stepper{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:18px 0;
}

.fiber-step{
  padding:10px 12px;
  border-radius:14px;
  background:#fff;
  border:1px solid var(--line);
  color:var(--text-muted);
  font-size:11px;
  font-weight:900;
  text-align:center;
}

.fiber-step.active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.fiber-step.done{
  background:var(--success-soft);
  border-color:#c8e8d9;
  color:var(--success);
}

.fiber-section{
  margin-top:16px;
}

.fiber-form{
  background:#fff;
  border:1px solid #e9dfd3;
  border-radius:20px;
  padding:18px;
  box-shadow:var(--shadow);
}

.fiber-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.fiber-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.fiber-field-full{
  grid-column:1 / -1;
}

.fiber-field label{
  font-size:11px;
  font-weight:800;
  color:var(--text-soft);
}

.fiber-field input,
.fiber-field textarea{
  width:100%;
  border:1.5px solid var(--line-strong);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-family:'Vazirmatn',sans-serif;
  font-size:13px;
  font-weight:700;
  outline:none;
  box-sizing:border-box;
  transition:border-color .18s,box-shadow .18s;
}

.fiber-field input{
  height:42px;
  padding:0 12px;
}

.fiber-field textarea{
  min-height:86px;
  padding:10px 12px;
  resize:vertical;
  line-height:1.9;
}

.fiber-field input:focus,
.fiber-field textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(31,59,91,.08);
}

.fiber-field input.invalid,
.fiber-field textarea.invalid{
  border-color:var(--danger);
  box-shadow:0 0 0 4px rgba(217,64,64,.08);
}

.fiber-field input.valid,
.fiber-field textarea.valid{
  border-color:#b9dfcf;
}

.fiber-next-btn{
  margin-top:14px;
}

.fiber-tile-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:12px;
}

.fiber-tile{
  width:100%;
  min-height:160px;
  border:1.5px solid var(--line);
  border-radius:18px;
  background:#fff;
  padding:14px;
  text-align:right;
  cursor:pointer;
  position:relative;
  transition:.18s;
  font-family:'Vazirmatn',sans-serif;
}

.fiber-tile:hover{
  border-color:var(--brand-mid);
  background:#f9fbfd;
  transform:translateY(-1px);
}

.fiber-tile.selected{
  border-color:var(--brand);
  background:var(--brand-soft);
}

.fiber-tile .rdot{
  position:absolute;
  top:14px;
  left:14px;
}

.fiber-tile.selected .rdot{
  background:var(--brand);
  border-color:var(--brand);
}

.fiber-tile.selected .rdot::after{
  display:block;
}

.fiber-tile-title{
  padding-left:26px;
  font-size:14px;
  font-weight:900;
  color:var(--text);
  margin-bottom:7px;
}

.fiber-tile-desc{
  font-size:11px;
  line-height:1.9;
  color:var(--text-soft);
  min-height:38px;
}

.fiber-tile-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}

.fiber-tile-meta span{
  display:inline-flex;
  padding:4px 8px;
  border-radius:999px;
  background:var(--panel-soft);
  border:1px solid #eee4d8;
  color:var(--text-soft);
  font-size:10px;
  font-weight:800;
}

.fiber-tile-price{
  margin-top:12px;
  font-size:18px;
  font-weight:900;
  color:var(--brand);
}

.fiber-tile-badge{
  display:inline-flex;
  margin-top:8px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:10px;
  font-weight:900;
}

.fiber-detail-box{
  margin-top:16px;
  padding:18px;
  border:1px solid #e9dfd3;
  border-radius:20px;
  background:#fff;
  box-shadow:var(--shadow);
}

.fiber-actions{
  display:flex;
  gap:10px;
  margin-top:16px;
}

.fiber-actions .btn-p,
.fiber-actions .btn-o{
  flex:1;
  justify-content:center;
}

.fiber-modem-img{
  height:120px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e6edf4;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:12px;
  overflow:hidden;
}

.fiber-modem-img img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.fiber-checkout-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,390px);
  gap:16px;
  align-items:start;
}

.fiber-final-card{
  background:#fff;
  border:1px solid #e9dfd3;
  border-radius:20px;
  padding:16px;
  box-shadow:var(--shadow);
}

.fiber-final-card .btn-p{
  margin-top:12px;
}

@media (max-width:900px){
  .fiber-stepper,
  .fiber-form-grid,
  .fiber-checkout-grid{
    grid-template-columns:1fr;
  }

  .fiber-actions{
    flex-direction:column;
  }
}
/* کد تخفیف پیش‌فاکتور خرید سرویس */
.discount-box{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  margin:0 0 16px;
  box-shadow:0 10px 24px rgba(31,59,91,.06);
}
.discount-title{
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--brand);
  font-size:13px;
  font-weight:900;
  margin-bottom:10px;
}
.discount-title .mi{font-size:18px}
.discount-form-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:start;
}
.discount-input{
  width:100%;
  height:42px;
  border:1.5px solid var(--line-strong);
  border-radius:14px;
  padding:0 14px;
  outline:none;
  font-size:13px;
  font-weight:800;
  direction:ltr;
  text-align:left;
  background:#fff;
}
.discount-input:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(31,59,91,.08);
}
.discount-apply-btn{height:42px;white-space:nowrap}
.discount-msg{margin-top:7px;min-height:18px}
.discount-msg.success{color:var(--success)}
.discount-msg.err{color:var(--danger)}
@media (max-width:640px){
  .discount-form-row{grid-template-columns:1fr}
  .discount-apply-btn{width:100%;justify-content:center}
}


.discount-input.locked,
.discount-input[readonly]{
  opacity:.75;
  cursor:not-allowed;
  background:#f3f6fb;
}
