/* مِتُدا — حساب کاربری و فروشگاه فایل */
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root { --bg: #f4f6f9; --card: #fff; --ink: #14202b; --mid: #5b6b7a; --line: #e3e8ee; --teal: #0f8f86; --teal-soft: #e3f4f2; --bad: #c53d3d; --bad-soft: #fbe9e9; --warn: #b7791f; --warn-soft: #fdf3e1; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Vazirmatn', Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.75; }
html[lang=en] body { font-family: system-ui, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.2rem; }
main.wrap { padding-top: 1.6rem; padding-bottom: 2.5rem; min-height: 70vh; }
h1 { font-size: 1.45rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: .98rem; margin: 1.2rem 0 .6rem; }

.top { background: #0e1a24; color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; min-height: 58px; }
.brand { color: #fff; font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.top nav a, .top nav .link { color: #c9d6e0; padding: .35rem .7rem; border-radius: 8px; font-size: .9rem; }
.top nav a:hover, .top nav .link:hover { background: #1f3343; color: #fff; text-decoration: none; }
.langs { display: inline-flex; gap: .15rem; margin-inline-start: .5rem; padding-inline-start: .5rem; border-inline-start: 1px solid #2c4253; }
.langs a { font-size: .8rem !important; padding: .25rem .5rem !important; }
.langs a.on { background: var(--teal); color: #fff; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; cursor: pointer; font: inherit; color: var(--teal); padding: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; }
.narrow { max-width: 460px; margin-inline: auto; }
.muted { color: var(--mid); }
.small { font-size: .84rem; }
.mono { font-family: Consolas, 'Courier New', monospace; letter-spacing: .03em; }
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.alert.ok { background: var(--teal-soft); color: #0b6b64; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warnbox { background: var(--warn-soft); color: #7a4f10; border: 1px solid #f0d9ad; }

.form label { display: block; margin-bottom: .85rem; font-weight: 600; font-size: .92rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-weight: 400; background: #fbfcfd; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: transparent; }
.btn { display: inline-block; background: var(--teal); color: #fff; border: 1px solid var(--teal); border-radius: 10px; padding: .6rem 1.3rem; font: inherit; font-weight: 700; cursor: pointer; margin: .15rem 0; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--teal); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head-row h1 { margin: 0; }

.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.tbl th { color: var(--mid); font-weight: 600; font-size: .84rem; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef1f5; color: var(--mid); white-space: nowrap; }
.badge.good { background: var(--teal-soft); color: #0b6b64; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.product { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 0; }
.product h2 { font-size: 1rem; margin: 0; }
.product .price { font-weight: 800; color: var(--teal); margin-top: auto; }
.radio { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; cursor: pointer; font-weight: 400 !important; }
.radio:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.radio input { margin-top: .4rem; }
.radio b { display: block; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0 0 .5rem; }
.facts dt { color: var(--mid); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; word-break: break-all; }
.amount { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; list-style: none; padding: 0; margin: 1rem 0; }
.codes li { font-family: Consolas, monospace; font-size: 1.1rem; text-align: center; padding: .5rem; background: #f7f9fb; border: 1px dashed #c7d0da; border-radius: 8px; direction: ltr; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

.thread { display: flex; flex-direction: column; gap: .8rem; }
.msg { max-width: 85%; padding: .7rem .9rem; border-radius: 12px; background: #f3f6f9; }
.msg.user { align-self: flex-start; background: var(--teal-soft); }
.msg.admin { align-self: flex-end; background: #f3f6f9; border: 1px solid var(--line); }
.msg .who { margin-bottom: .2rem; }
.msg .body { white-space: normal; word-wrap: break-word; }

.foot { padding: 1.2rem; text-align: center; }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .tbl { font-size: .85rem; }
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .5rem; }
  .langs { margin-inline-start: 0; padding-inline-start: 0; border: 0; }
}
@media print { .top, .foot, .btn, form { display: none !important; } .card { border: 0; } }
.tbl td { overflow-wrap: anywhere; }
.price-row { margin: auto 0 .4rem; }
.price del { color: var(--mid); font-weight: 400; font-size: .9em; margin-inline-end: .3rem; }
.price b { color: var(--bad); }
.narrow { max-width: 560px; }

/* ───── سبد، تسویه و پرداخت جمع‌وجور (موبایل‌محور) ───── */
.btn-wide { display: block; width: 100%; text-align: center; margin: .45rem 0; }
.sum { border: 1px solid var(--line); border-radius: 12px; padding: .2rem .9rem; margin: .4rem 0 1rem; background: #fbfcfd; }
.sum summary { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; cursor: pointer; list-style: none; font-weight: 700; }
.sum summary::-webkit-details-marker { display: none; }
.sum-list { list-style: none; margin: 0 0 .6rem; padding: 0; font-size: .9rem; }
.sum-list li { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem 0; border-top: 1px dashed var(--line); }
.sum-list li.tier { color: var(--teal); font-weight: 700; }
.sum-list li.total { font-size: 1rem; }
.sum-list del { color: var(--mid); font-size: .85em; }
.pay-box { border: 1px solid var(--line); border-radius: 14px; padding: .9rem; margin-bottom: .8rem; }
.pay-row { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.pay-row:last-of-type { border-bottom: 0; }
.pay-row .big { display: block; font-size: 1.35rem; letter-spacing: .02em; margin: .15rem 0 .35rem; }
.copies { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0; }
.copy { font: inherit; font-size: .8rem; font-weight: 700; padding: .4rem .75rem; border-radius: 9px; border: 1px solid var(--teal); background: var(--teal-soft); color: #0b6b64; cursor: pointer; }
.copy.done { background: var(--teal); color: #fff; }
.live { color: var(--mid); display: flex; gap: .45rem; align-items: center; margin: .6rem 0 0; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); animation: pulse 1.6s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .35; } }
.fallback { margin: .6rem 0; }
.fallback summary { cursor: pointer; color: var(--teal); font-weight: 600; font-size: .9rem; padding: .3rem 0; }
.qr-row { display: flex; gap: .9rem; align-items: center; margin-top: .6rem; }
.qr svg { width: 128px; height: 128px; display: block; background: #fff; border-radius: 8px; }
.addr { display: block; word-break: break-all; margin: .2rem 0; }
.files { display: flex; flex-direction: column; gap: .7rem; }
.file { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; }
.toast { position: fixed; inset-inline: 0; bottom: 1.2rem; margin: auto; width: max-content; background: #0e1a24; color: #fff; padding: .55rem 1.1rem; border-radius: 999px; font-weight: 700; z-index: 50; }
.secret { font-family: Consolas, monospace; font-size: 1.5rem; background: var(--warn-soft); padding: .5rem 1rem; border-radius: 10px; display: inline-block; letter-spacing: .08em; }
.orders { display: flex; flex-direction: column; gap: .7rem; }
.order-row { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; }
.order-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; font-size: .9rem; }
.order-file { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; padding: .45rem 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.order-file > span:first-child { flex: 1; min-width: 160px; }
.small-btn { padding: .3rem .8rem; font-size: .82rem; }
.cart-link b { color: #f5b041; }
.auto { border-color: var(--teal); }
.radio span small { display: block; margin-top: .15rem; }
@media (max-width: 560px) {
  main.wrap { padding-top: .9rem; }
  .card { padding: .9rem; border-radius: 12px; }
  .qr svg { width: 110px; height: 110px; }
  .pay-row .big { font-size: 1.2rem; }
}

[hidden] { display: none !important; }
.radio.rec { border-color: #f5b041; background: #fff8ec; }
.radio.rec b { color: #9a5b00; }

/* ───── فاکتور «چاپگر رسید»: دستگاه تیره، شکاف چاپ، کاغذی که مرحله‌به‌مرحله بیرون می‌آید ───── */
.rp { max-width: 420px; margin: 10px auto 0; display: grid; justify-items: center; }
.rp__printer { position: relative; z-index: 2; width: 100%; padding: 14px 14px 16px; border-radius: 26px; background: linear-gradient(180deg, #1c2b36, #0e1a24);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 30px 50px -30px rgba(0,0,0,.6); color: #eef3f6; }
.rp__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rp__logo svg { width: 32px; height: 32px; display: block; }
.rp__home { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: #24394a; color: #eef3f6; font-size: 12.5px; font-weight: 700; box-shadow: 0 2px 0 #071017; }
.rp__home:hover { text-decoration: none; filter: brightness(1.1); }
.rp__panel { padding: 14px 16px; border-radius: 16px; background: #0a141c; border: 1px solid rgba(255,255,255,.06); }
.rp__row { display: flex; justify-content: space-between; gap: 12px; }
.rp__row b { display: block; font-size: 15px; } .rp__row small { color: rgba(238,243,246,.6); font-size: 12px; }
.rp__total { text-align: left; } .rp__total b { font-size: 17px; font-variant-numeric: tabular-nums; color: #f5b041; }
.rp__status { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: rgba(238,243,246,.88); }
.rp__dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #17b3b6; border-top-color: transparent; animation: rp-spin .9s linear infinite; flex: none; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
.rp[data-stage="complete"] .rp__dot { border: 0; animation: none; background: #2fbf71 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/11px no-repeat; }
.rp[data-stage="idle"] .rp__dot { animation: none; border-color: #8a98a3; }
.rp__slot { position: absolute; left: 16px; right: 16px; bottom: 7px; height: 6px; border-radius: 6px; background: #03080c; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.rp__feed { position: relative; z-index: 1; width: 84%; margin-top: -9px; overflow: hidden; padding-bottom: 12px; }
.rp__paper { position: relative; padding: 24px 20px 18px; background: #fdfcf8; color: #1a1a18; box-shadow: 0 18px 30px -18px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.04);
  font-variant-numeric: tabular-nums; font-size: 12.5px; transform: translateY(-101%); background-image: linear-gradient(180deg, rgba(0,0,0,.06), transparent 18px); }
.rp__paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background: linear-gradient(135deg, #fdfcf8 50%, transparent 50%) 0 0 / 12px 8px repeat-x, linear-gradient(225deg, #fdfcf8 50%, transparent 50%) 0 0 / 12px 8px repeat-x; }
.rp[data-stage="printing"] .rp__paper { animation: rp-feed 3.1s cubic-bezier(.45,.05,.3,1) forwards; }
.rp[data-stage="complete"] .rp__paper { transform: none; }
@keyframes rp-feed { 0% { transform: translateY(-101%); } 18% { transform: translateY(-82%); } 26% { transform: translateY(-82%); } 46% { transform: translateY(-55%); } 54% { transform: translateY(-55%); } 74% { transform: translateY(-26%); } 82% { transform: translateY(-26%); } 100% { transform: none; } }
.rp__plogo { display: block; width: 40px; margin: 0 auto 6px; } .rp__plogo svg { width: 40px; height: 40px; display: block; }
.rp__brand { text-align: center; font-weight: 900; font-size: 15px; margin: 0; } .rp__brand small { display: block; font-weight: 500; font-size: 11px; color: #77746c; letter-spacing: .5px; }
.rp__paper hr { border: 0; border-top: 1px dashed #b9b4a8; margin: 12px 0; }
.rp__line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; } .rp__line span:first-child { color: #66635b; }
.rp__sub { font-size: 11px; color: #77746c; }
.rp__sum b:last-child { font-size: 17px; }
.rp__bar { display: block; width: 70%; height: 38px; margin: 16px auto 6px; fill: #1a1a18; }
.rp__thanks { text-align: center; font-size: 11.5px; color: #66635b; margin: 0; }
.rp__note { text-align: center; margin: 14px 0; font-size: 13px; }
.rp__act { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rp[data-stage="idle"][data-paid="1"] .rp__feed { display: none; }
.rp[data-stage="processing"] .rp__feed { height: 0; padding: 0; }
.rp[data-stage="printing"] .rp__feed { animation: rp-grow 3.1s cubic-bezier(.45,.05,.3,1) forwards; }
.rp[data-paid="0"] .rp__paper { transform: none; }
@keyframes rp-grow { 0% { height: 0; } 18% { height: calc(var(--H) * .18); } 26% { height: calc(var(--H) * .18); } 46% { height: calc(var(--H) * .45); } 54% { height: calc(var(--H) * .45); } 74% { height: calc(var(--H) * .74); } 82% { height: calc(var(--H) * .74); } 100% { height: calc(var(--H) + 12px); } }
@media (prefers-reduced-motion: reduce) { .rp__paper { transform: none !important; animation: none !important; } }
@media print { .top, .foot, .rp__printer, .rp__note, .rp__act { display: none !important; } .rp__feed { width: 100%; overflow: visible; height: auto !important; } .rp__paper { transform: none !important; box-shadow: none; } body { background: #fff; } }

.cancel-row { text-align: center; margin: 1rem 0 .2rem; }
.link-danger { background: none; border: 0; color: var(--bad); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.link-danger:hover { text-decoration: underline; }
.sum-list .rm { color: var(--bad); text-decoration: none; font-weight: 800; padding: 0 .3rem; }

.steps-list { padding-inline-start: 1.3rem; line-height: 2; margin: .4rem 0 1rem; }
