/*
 * فرم‌های ارتباطی و پیگیری پیام
 *   .sf-*  بدنه مشترک فرم (صفحه فرم و جزء «فرم» صفحه‌ساز)
 *   .fm-*  چیدمان صفحه فرم‌ها (ستون کناری اطلاعات تماس، نقشه، مراحل و راه‌های دیگر ارتباط)
 *   .tk-*  نتیجه پیگیری (وضعیت سه‌مرحله‌ای و پاسخ‌ها)
 */

/* ================================================================ بدنه فرم */
.sf{position:relative;padding:30px;border:1px solid #dbe6df;border-radius:22px;background:#fff;box-shadow:0 18px 44px #094b550d;color:#354f54}
.sf:before{content:'';position:absolute;inset:0 0 auto;height:4px;border-radius:22px 22px 0 0;background:linear-gradient(90deg,var(--brand),#2f8a85 60%,#c9b07a)}
.sf-head{margin-bottom:18px}
.sf-head h2{font-size:21px;line-height:1.8;color:var(--brand)}
.sf-head p{margin-top:6px;font-size:14px;line-height:2;color:#637a78}
.sf-legend{margin:0 0 18px;font-size:12px;color:#7a8f8b}
.sf-star{color:#c0392b;font-weight:700}
.sf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px}
.sf-field{display:flex;flex-direction:column;gap:7px;min-width:0}
.sf-field.is-wide{grid-column:1/-1}
.sf-field label,.sf-label,.sf-captcha label{font-size:13px;font-weight:600;color:#2f4d52}
.sf-field label small,.sf-label small{margin-inline-start:4px;font-size:11px;font-weight:400;color:#8a9d99}
.sf-field input,.sf-field textarea,.sf-field select,.sf-captcha input{width:100%;min-height:48px;padding:11px 14px;border:1px solid #cddcd4;border-radius:12px;background:#fbfdfc;color:var(--text);font:inherit;font-size:14px;transition:border-color .2s,box-shadow .2s,background .2s}
.sf-field textarea{min-height:150px;line-height:2;resize:vertical}
.sf-field select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#5e7b76 50%),linear-gradient(135deg,#5e7b76 50%,transparent 50%);background-position:left 18px center,left 13px center;background-size:5px 5px;background-repeat:no-repeat;padding-left:34px}
[dir=ltr] .sf-field select{background-position:right 13px center,right 18px center;padding-left:14px;padding-right:34px}
.sf-field input:hover,.sf-field textarea:hover,.sf-field select:hover{border-color:#a9c4b8}
.sf-field input:focus,.sf-field textarea:focus,.sf-field select:focus,.sf-captcha input:focus{outline:0;border-color:var(--brand);background:#fff;box-shadow:0 0 0 4px #075b6914}
.sf-field input[dir=ltr]{text-align:left}
.sf-field.has-error input,.sf-field.has-error textarea,.sf-field.has-error select,.sf-captcha.has-error input{border-color:#d36b5f;background:#fffafa}
.sf-field.has-error input:focus,.sf-field.has-error textarea:focus{box-shadow:0 0 0 4px #c0392b14}
.sf-error{display:flex;align-items:center;gap:6px;margin:0;font-size:12px;color:#b2392b}
.sf-error:before{content:'!';display:grid;place-items:center;flex:none;width:16px;height:16px;border-radius:50%;background:#b2392b;color:#fff;font-size:10px;font-weight:800}
.sf-error[hidden]{display:none}
.sf-hint{font-size:11px;color:#7a8f8b}
.sf-count{align-self:flex-end;margin-top:-2px;font-size:11px;color:#8a9d99}
.sf-field.is-near .sf-count{color:#b57d1e;font-weight:600}

/* پیوست: کشیدن و رها کردن */
.sf-drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:22px 16px;border:1.5px dashed #b5cdc0;border-radius:16px;background:#f6faf8;text-align:center;cursor:pointer;transition:border-color .2s,background .2s}
.sf-drop:hover,.sf-drop.is-over{border-color:var(--brand);background:#ecf5f0}
.sf-drop svg{width:30px;height:30px;fill:none;stroke:var(--brand);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sf-drop-text{font-size:13px;color:#4a6763}
.sf-drop-text b{color:var(--brand)}
.sf-drop small{font-size:11px;color:#8a9d99}
.sf-drop input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.sf-drop:focus-within{outline:2px solid var(--brand);outline-offset:3px}
.sf-drop[hidden],.sf-file[hidden]{display:none}
.sf-field.has-error .sf-drop{border-color:#d36b5f;background:#fffafa}
.sf-file{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #cfe0d6;border-radius:14px;background:#f1f7f3;animation:sf-in .3s ease}
.sf-file-ext{min-width:46px;padding:7px 0;border-radius:9px;background:var(--brand);color:#fff;font:700 11px Arial,sans-serif;text-align:center}
.sf-file-name{flex:1;min-width:0;font-size:13px;font-weight:600;color:#2f4d52;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sf-file-size{font-size:11px;color:#7a8f8b}
.sf-file-remove{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:9px;background:#fff;color:#b2392b;font-size:20px;line-height:1;cursor:pointer}
.sf-file-remove:hover{background:#fdecea}

/* تله ربات */
.sf-hp{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* کپچا */
.sf-captcha{display:flex;flex-direction:column;gap:7px;margin-top:20px;padding-top:20px;border-top:1px dashed #d6e3dc}
.sf-captcha-row{display:flex;align-items:center;gap:10px}
.sf-captcha-img{display:grid;place-items:center;width:150px;height:50px;flex:none;overflow:hidden;border:1px solid #d6e3dc;border-radius:12px;background:repeating-linear-gradient(45deg,#f2f7f4,#f2f7f4 6px,#eaf2ed 6px,#eaf2ed 12px)}
.sf-captcha-img img{display:block;width:100%;height:100%;object-fit:contain}
.sf-captcha.is-loading .sf-captcha-img{animation:sf-pulse 1s ease-in-out infinite alternate}
.sf-captcha-refresh{display:grid;place-items:center;flex:none;width:44px;height:44px;border:1px solid #cddcd4;border-radius:12px;background:#fff;color:var(--brand);cursor:pointer;transition:transform .3s}
.sf-captcha-refresh:hover{transform:rotate(-90deg)}
.sf-captcha-refresh svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sf-captcha input{max-width:160px;text-align:center;letter-spacing:4px;font-weight:700}

/* پیام خطای کلی و دکمه ارسال */
.sf-alert{margin-top:20px;padding:13px 16px;border:1px solid #f1c4bd;border-radius:12px;background:#fdf1ef;font-size:13px;line-height:1.9;color:#9b3326;animation:sf-in .3s ease}
.sf-alert[hidden]{display:none}
.sf-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}
.sf-privacy{display:flex;align-items:flex-start;gap:8px;max-width:520px;margin:0;font-size:12px;line-height:1.9;color:#7a8f8b}
.sf-privacy svg{flex:none;width:17px;height:17px;margin-top:2px;fill:none;stroke:#8fb5a2;stroke-width:1.8;stroke-linejoin:round}
.sf-submit{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-width:170px;min-height:50px;padding:10px 28px;border:0;border-radius:14px;background:linear-gradient(135deg,var(--brand),#0b7480);color:#fff;font:inherit;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 10px 22px #075b6930;transition:transform .2s,box-shadow .2s,opacity .2s}
.sf-submit:hover{transform:translateY(-2px);box-shadow:0 14px 26px #075b6938}
.sf-submit:disabled{cursor:progress;opacity:.8;transform:none}
.sf-spinner{display:none;width:17px;height:17px;border:2px solid #ffffff55;border-top-color:#fff;border-radius:50%;animation:sf-spin .7s linear infinite}
.sf-submit.is-busy .sf-spinner{display:block}

/* پیام موفقیت */
.sf-done{padding:16px 6px;text-align:center;animation:sf-in .45s ease}
.sf-done:focus{outline:0}
.sf-done[hidden],.sf-form[hidden]{display:none}
.sf-done-icon{display:inline-grid;place-items:center;width:74px;height:74px;margin-bottom:14px;border-radius:50%;background:radial-gradient(circle,#e2f3ea 55%,#f1f9f4 56%);color:#16794b}
.sf-done-icon svg{width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:30;stroke-dashoffset:30;animation:sf-check .6s .2s ease forwards}
.sf-done h2{font-size:22px;color:var(--brand)}
.sf-done-message{max-width:560px;margin:10px auto 0;font-size:14px;line-height:2;color:#5c7472}
.sf-code{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 16px;margin:22px auto 6px;padding:14px 20px;border:1px dashed #c9b07a;border-radius:16px;background:#fbf8ef}
.sf-code span{font-size:12px;color:#8a6f2f}
.sf-code strong{font:800 26px/1.4 Vazirmatn,monospace;letter-spacing:3px;color:#5c4818}
.sf-copy{min-height:36px;padding:4px 14px;border:1px solid #c9b07a;border-radius:10px;background:#fff;color:#7d6630;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .2s}
.sf-copy:hover,.sf-copy.is-done{background:#f3ead3}
.sf-done-hint{margin:8px 0 22px;font-size:12px;color:#7a8f8b}
.sf-done-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.sf-btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:9px 22px;border:1px solid var(--brand);border-radius:12px;background:var(--brand);color:#fff;font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .2s}
.sf-btn:hover{background:var(--brand-deep)}
.sf-btn.is-ghost{background:#fff;color:var(--brand)}
.sf-btn.is-ghost:hover{background:#eef5f1}

/* جزء فرم در صفحه‌ساز */
.pg-form .sf{box-shadow:none}

/* ================================================================ چیدمان صفحه فرم */
.fm-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:30px;align-items:start}
.fm-layout.no-form{grid-template-columns:minmax(0,1fr)}
.fm-layout.no-form .fm-aside{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px}
.fm-aside{display:flex;flex-direction:column;gap:18px;position:sticky;top:110px}
.fm-card{padding:22px;border:1px solid #dbe6df;border-radius:20px;background:#fff}
.fm-card h2{margin-bottom:14px;font-size:17px;color:var(--brand)}
.fm-card h3{margin:18px 0 10px;font-size:13px;color:#4a6763}
.fm-contact{background:linear-gradient(160deg,#f3f8f5,#fff 60%)}
.fm-lines{display:flex;flex-direction:column;gap:14px;margin:0;padding:0;list-style:none}
.fm-lines li{display:flex;gap:12px;align-items:flex-start}
.fm-lines li>div{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:13px;line-height:1.9;color:#354f54}
.fm-lines small{font-size:11px;color:#7f948f}
.fm-lines a{color:var(--brand);font-weight:600}
.fm-phones{display:flex;flex-wrap:wrap;gap:2px 12px}
.fm-ico{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:12px;background:#e5efea;color:var(--brand)}
.fm-ico svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fm-emails{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}
.fm-emails li{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 10px;padding:9px 12px;border-radius:10px;background:#f4f8f6;font-size:12px}
.fm-emails a{color:var(--brand);font-weight:600}
.fm-map{padding:0;overflow:hidden}
.fm-map iframe{display:block;width:100%;height:260px;border:0;filter:saturate(.85)}
.fm-directions{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;background:#f4f8f6;color:var(--brand);font-size:13px;font-weight:700;transition:background .2s}
.fm-directions:hover{background:#e5efea}
.fm-directions svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}

/* مراحل رسیدگی */
.fm-steps ol{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none;counter-reset:fm}
.fm-steps ol li{position:relative;display:flex;flex-direction:column;gap:3px;padding:0 0 18px;padding-inline-start:46px;counter-increment:fm}
.fm-steps ol li:before{content:counter(fm);position:absolute;inset-inline-start:0;top:0;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--brand);color:#fff;font-size:13px;font-weight:700}
.fm-steps ol li:not(:last-child):after{content:'';position:absolute;inset-inline-start:15px;top:34px;bottom:2px;width:2px;background:repeating-linear-gradient(180deg,#c9dcd2 0 4px,transparent 4px 8px)}
.fm-steps b{font-size:14px;color:#2f4d52}
.fm-steps ol li span{font-size:12px;line-height:1.9;color:#6c827e}
.fm-track{display:flex;align-items:center;justify-content:space-between;margin-top:6px;padding:12px 14px;border-radius:12px;background:#fbf8ef;color:#7d6630;font-size:13px;font-weight:700}
.fm-track:hover{background:#f3ead3}
[dir=ltr] .fm-track span{transform:scaleX(-1)}
.fm-tips{display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none}
.fm-tips li{position:relative;padding-inline-start:20px;font-size:13px;line-height:1.9;color:#4f6966}
.fm-tips li:before{content:'';position:absolute;inset-inline-start:2px;top:10px;width:7px;height:7px;border-radius:50%;background:#c9b07a}

/* نشانی‌های دیگر و راه‌های دیگر ارتباط */
.fm-addresses,.fm-others{margin-top:46px}
.fm-address-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.fm-address h3{margin:0 0 8px;font-size:15px;color:var(--brand)}
.fm-address p{font-size:13px;line-height:1.9}
.fm-address dl{display:flex;flex-direction:column;gap:6px;margin:12px 0 0}
.fm-address dl div{display:flex;justify-content:space-between;gap:10px;font-size:12px}
.fm-address dt{color:#7f948f}
.fm-address dd{margin:0;font-weight:600;color:#354f54}
.fm-other-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}
.fm-other{display:flex;align-items:center;gap:14px;padding:18px;border:1px solid #dbe6df;border-radius:18px;background:#fff;transition:transform .25s,box-shadow .25s,border-color .25s}
.fm-other:hover{transform:translateY(-3px);border-color:#a9c4b8;box-shadow:0 14px 30px #094b5512}
.fm-other-ico{display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:14px;background:linear-gradient(140deg,var(--brand-deep),var(--brand));color:#fff}
.fm-other-suggestion .fm-other-ico{background:linear-gradient(140deg,#7d6630,#b39752)}
.fm-other-inforequest .fm-other-ico{background:linear-gradient(140deg,#2c4f86,#3f6fb3)}
.fm-other-track .fm-other-ico{background:linear-gradient(140deg,#5c3e70,#8a5ea5)}
.fm-other-ico svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fm-other-copy{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
.fm-other-copy b{font-size:14px;color:#21474d}
.fm-other-copy small{font-size:12px;line-height:1.8;color:#71878a}
.fm-other-go{color:#9ab1aa;transition:transform .25s}
.fm-other:hover .fm-other-go{transform:translateX(-4px);color:var(--brand)}
[dir=ltr] .fm-other-go{transform:scaleX(-1)}
[dir=ltr] .fm-other:hover .fm-other-go{transform:scaleX(-1) translateX(-4px)}

/* ================================================================ نتیجه پیگیری */
.tk{position:relative;padding:30px;border:1px solid #dbe6df;border-radius:22px;background:#fff;box-shadow:0 18px 44px #094b550d}
.tk:before{content:'';position:absolute;inset:0 0 auto;height:4px;border-radius:22px 22px 0 0;background:linear-gradient(90deg,#5c3e70,#8a5ea5 50%,#c9b07a)}
.tk-form .sf-actions{margin-top:20px}
.tk-result{animation:sf-in .45s ease}
.tk-result:focus{outline:0}
.tk-result[hidden],.tk-form[hidden]{display:none}
.tk-summary{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:20px;border-bottom:1px solid #e3ece7}
.tk-form-title{font-size:12px;font-weight:700;color:#897647}
.tk-subject{margin:4px 0 12px;font-size:20px;line-height:1.8;color:var(--brand)}
.tk-meta{display:flex;flex-wrap:wrap;gap:8px 22px;margin:0}
.tk-meta div{display:flex;gap:6px;font-size:12px}
.tk-meta dt{color:#7f948f}
.tk-meta dd{margin:0;font-weight:700;color:#354f54}
.tk-meta div[hidden]{display:none}
.tk-status{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:4px 16px;border-radius:999px;background:#fff4dc;font-size:13px;font-weight:700;color:#94661a}
.tk-status:before{content:'';width:8px;height:8px;border-radius:50%;background:currentColor;animation:sf-pulse 1.2s ease-in-out infinite alternate}
.tk-status.is-inreview{background:#e4f0f8;color:#24668f}
.tk-status.is-answered{background:#e2f3ea;color:#16794b}
.tk-status.is-answered:before{animation:none}

.tk-steps{display:grid;grid-template-columns:repeat(3,1fr);margin:26px 0 8px;padding:0;list-style:none}
.tk-steps li{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 8px;text-align:center}
.tk-steps li:not(:first-child):before{content:'';position:absolute;top:15px;inset-inline-end:50%;width:100%;height:3px;background:#e1ebe5;z-index:0}
.tk-steps li.is-done:not(:first-child):before,.tk-steps li.is-current:not(:first-child):before{background:linear-gradient(90deg,#2f8a85,var(--brand))}
.tk-dot{position:relative;z-index:1;display:grid;place-items:center;width:32px;height:32px;border:3px solid #e1ebe5;border-radius:50%;background:#fff;transition:background .3s,border-color .3s}
.tk-steps li.is-done .tk-dot{border-color:var(--brand);background:var(--brand)}
.tk-steps li.is-done .tk-dot:after{content:'';width:10px;height:6px;margin-top:-3px;border:solid #fff;border-width:0 0 2.5px 2.5px;transform:rotate(-45deg)}
.tk-steps li.is-current:not(.is-done) .tk-dot{border-color:var(--brand);box-shadow:0 0 0 6px #075b6918}
.tk-steps li.is-current:not(.is-done) .tk-dot:after{content:'';width:10px;height:10px;border-radius:50%;background:var(--brand)}
.tk-steps b{margin-top:6px;font-size:13px;color:#2f4d52}
.tk-steps li:not(.is-done):not(.is-current) b{color:#93a7a2}
.tk-steps small{font-size:11px;line-height:1.8;color:#7f948f}
.tk-replies-title{margin:28px 0 12px;font-size:15px;color:var(--brand)}
.tk-replies{display:flex;flex-direction:column;gap:12px}
.tk-reply{position:relative;padding:16px 18px;border-radius:16px;background:#f2f8f5;border-inline-start:4px solid var(--brand)}
.tk-reply time{font-size:11px;font-weight:700;color:#7d6630}
.tk-reply p{margin:6px 0 0;font-size:14px;line-height:2.1;white-space:pre-line;color:#30494d}
.tk-no-reply{padding:16px;border:1px dashed #c9dcd2;border-radius:14px;font-size:13px;text-align:center;color:#6c827e}
.tk-no-reply[hidden]{display:none}
.tk-again{margin-top:22px}

@keyframes sf-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes sf-spin{to{transform:rotate(360deg)}}
@keyframes sf-pulse{from{opacity:.55}to{opacity:1}}
@keyframes sf-check{to{stroke-dashoffset:0}}

@media(max-width:1000px){
  .fm-layout{grid-template-columns:1fr}
  .fm-aside{position:static}
}
@media(max-width:640px){
  .sf,.tk{padding:22px 16px;border-radius:18px}
  .sf-grid{grid-template-columns:1fr;gap:16px}
  .sf-actions{flex-direction:column-reverse;align-items:stretch}
  .sf-submit{width:100%}
  .sf-captcha-row{flex-wrap:wrap}
  .sf-captcha input{max-width:none;flex:1 1 120px}
  .sf-code strong{font-size:22px}
  .tk-steps small{display:none}
}
@media(prefers-reduced-motion:reduce){
  .sf *,.tk *,.fm-other{animation:none!important;transition:none!important}
  .sf-done-icon svg{stroke-dashoffset:0}
}
