:root{
  --bg:#f4f5f7;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --accent:#f59e0b;
  --danger:#dc2626;
  --radius:14px;
  --shadow:0 10px 25px rgba(17,24,39,.08);
}

@font-face {
    font-family: inter;
    src: url("../fonts/IRANSansX-Regular.woff2");

}

button{
    font-family: inter, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: inter;
  text-rendering:optimizeLegibility;
}

.page{max-width:980px; margin:0 auto; padding:24px;}
.topbar{padding:8px 4px 18px;}
.brand h1{margin:0; font-size:28px;}
.brand p{margin:6px 0 0; color:var(--muted);}

.wizard{display:flex; flex-direction:column; gap:14px;}

.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  border:1px solid rgba(17,24,39,.04);
  margin-bottom: 8px;
}

.card-title{margin:0 0 14px; font-size:18px;}

.section-title{margin:10px 0 10px; font-size:14px; color:var(--muted);}

.divider{height:1px; background:var(--line); margin:18px 0;}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}

@media (max-width: 720px){
  .grid{grid-template-columns: 1fr;}
}

.field{display:flex; flex-direction:column; gap:8px;}
.field > span{font-size:13px; color:#111827;}
.field input, .field select, .field textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  outline:none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  font-family: 'inter';
}

.field textarea{resize:vertical}
.field input:focus, .field select:focus, .field textarea:focus{
  border-color: rgba(245,158,11,.65);
  box-shadow: 0 0 0 4px rgba(245,158,11,.18);
}
.req{color:var(--danger); font-weight:700; margin-right:4px;}
.err{color:var(--danger); font-size:12px; min-height:16px;}

.inline{gap:10px;}
.inline-controls{display:flex; gap:10px; flex-wrap:wrap;}

.chips{display:flex; gap:10px; flex-wrap:wrap;}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  cursor:pointer;
  user-select:none;
  transition: transform .16s ease, box-shadow .16s ease;
}
.chip input{margin:0}
.chip:hover{transform: translateY(-1px); box-shadow:0 8px 16px rgba(17,24,39,.06);}
.chip.big{border-radius:14px; padding:12px 14px; width:100%}

.table-wrap{
    display:flex; 
    flex-direction:column; 
    gap:10px;
    width: 100%;
    overflow-x: auto;  
}

.table{
    min-width: 600px;
    width: 100%;
    table-layout:auto;
    border-collapse:separate;
    border-spacing:0;
    overflow:scroll;
    border-radius:12px;
    border:1px solid var(--line);
}
.table thead th{
  background:#fafafa;
  font-size:12px;
  color:var(--muted);
  padding:10px;
  border-bottom:1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align:right;
}
.table thead th:last-child{
  border-left: 0px;
}
.table td{
  min-width: 120px;
  padding:8px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
}
.table th, .table td{
    overflow: scroll;
}
.table tbody tr td{
  border-left: 1px solid var(--line);
}
.table tbody tr td:last-child{
  border-left: 0px;
}
.table tbody tr:last-child td{border-bottom:none;}
.table td input{
    padding:8px 10px; 
    border-radius:10px;
    width: 100%;                /* خیلی مهم */
    min-width: 0;               /* خیلی مهم (برای جلوگیری از overflow) */
    max-width: 100%;
}

.btn{
  border:none;
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn.primary{
  background:var(--accent);
  color:#111827;
  box-shadow:0 10px 20px rgba(245,158,11,.22);
}
.btn.ghost{
  background:transparent;
  border:1px solid var(--line);
  color:var(--text);
}
.btn:hover{transform: translateY(-1px);}
.actions{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:16px;
}
.spacer{flex:1}

.alert{
  background:#fff7ed;
  border:1px solid rgba(245,158,11,.35);
  color:#92400e;
  padding:10px 12px;
  border-radius:12px;
}

/* Stepper */
.stepper{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 8px;
}
.stepper-line{
  position:absolute;
  left:12px;
  right:12px;
  top:50%;
  height:2px;
  background:var(--line);
  transform: translateY(-50%);
}
.step-dot{
  position:relative;
  z-index:1;
  width:34px;
  height:34px;
  border-radius:999px;
  border:2px solid var(--line);
  background:#fff;
  display:grid;
  place-items:center;
  color:var(--muted);
}
.step-dot.is-active, .step-dot.is-done{
  border-color: rgba(245,158,11,.65);
}
.step-dot.is-active{
  background: rgba(245,158,11,.18);
  color:#111827;
}
.step-dot.is-done{
  background: var(--accent);
  color:#111827;
}

/* Steps animation */
.step{display:none; opacity:0; transform: translateY(6px);}
.step.is-visible{
  display:block;
  opacity:1;
  transform: translateY(0);
  animation: fadeInUp .18s ease both;
}

@keyframes fadeInUp{
  from{opacity:0; transform:translateY(8px)}
  to{opacity:1; transform:translateY(0)}
}

/* Triple selects */
.triple{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:8px;
}
.triple label{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted);}
.triple select{padding:8px 10px; border-radius:10px;}

.note{color:var(--muted); font-size:12px; margin:12px 0 0;}


#finishAlert{
  background: rgba(0, 0, 0, 0.473);
  position: absolute;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 98;
}
#finishAlert .content{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 250px;
  z-index: 99;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0px 0px 16px 8px rgba(255, 255, 255, 0.849);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 10px;
}
#finishAlert .content .text-holder{
  height: 130px;
  width: 100%;
}
#finishAlert .content .code-holder{
  height: 50px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#finishAlert .content .counter-con{
  height: 70px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-container {
  position: relative;
  width: 50px;
  height: 50px;
  margin: 10px auto;
}

.timer-svg {
  transform: rotate(-90deg);
}

.timer-circle-bg {
  fill: none;
  stroke: #c9c9c9;
  stroke-width: 4;
}

.timer-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #333;
}

@media (max-width: 490px){
  #finishAlert .content{
    width: 250px;
    height: 300px;
    font-size: 12px;
  }
  #finishAlert .content .text-holder{
    height: 160px;
    width: 100%;
    font-size: 16px;
  }
  #finishAlert .content .code-holder{
    height: 40px;
    
  }
  #finishAlert .content .counter-con{
    height: 100px;
    
}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{transition:none !important; animation:none !important;}
}
