/* =========================================================
   Dark Sistem – Contact page
   Uses the tokens from main.css (light + dark), RTL-first.
   All selectors are namespaced .ct-* so nothing else is touched.
   ========================================================= */

.ct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Hero (dark in both themes, like the design) ---------- */
.ct-hero { position: relative; isolation: isolate; overflow: hidden; background: #05041a; color: #fff; border-bottom: 1px solid rgba(139, 92, 246, .35); }
.ct-hero__bg { position: absolute; inset: 0; z-index: -1; background: url("../img/services-bg.webp") left center / cover no-repeat; }
.ct-hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(5, 4, 26, .97) 0, rgba(5, 4, 26, .9) 34%, rgba(5, 4, 26, .35) 66%, rgba(5, 4, 26, .05) 100%); }
.ct-hero__in { display: flex; padding-block: clamp(2rem, 5vw, 3.6rem); }
.ct-hero__copy { max-width: 36rem; }
.ct-eyebrow { display: inline-block; padding-inline-start: .8rem; border-inline-start: 2px solid #8b5cf6; font-size: .9rem; color: #cfc8ff; margin-bottom: .9rem; }
.ct-hero h1 { font-size: clamp(1.9rem, 4.8vw, 3.1rem); font-weight: 800; line-height: 1.35; color: #fff; }
.ct-hero h1 span { background: linear-gradient(90deg, #c4a8ff, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ct-hero__lead { margin-top: .9rem; font-size: clamp(.92rem, 1.6vw, 1.05rem); line-height: 2; color: #e4dfff; }
.ct-feats { display: flex; flex-wrap: wrap; gap: .9rem clamp(1rem, 3vw, 2rem); margin-top: 1.4rem; }
.ct-feats li { display: flex; align-items: center; gap: .6rem; font-size: .85rem; font-weight: 500; color: #ece9ff; }
.ct-feats__ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid rgba(167, 139, 250, .5); background: rgba(14, 11, 40, .65); color: #c4a8ff; }
.ct-feats__ic .i { width: 20px; height: 20px; }

/* ---------- Layout ---------- */
#ticketForm { scroll-margin-top: calc(var(--header-h) + 16px); }
.ct-wrap { padding-block: clamp(1.4rem, 4vw, 2.4rem) clamp(2.4rem, 6vw, 4rem); }
.ct-grid { display: grid; gap: clamp(.9rem, 2vw, 1.4rem); grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, .92fr); align-items: stretch; }
.ct-card { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="dark"] .ct-card { background: linear-gradient(180deg, #0f0c2a, #0a0820); }

@media (max-width: 1099px) {
  .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-form-card { grid-column: 1 / -1; }
}
@media (max-width: 719px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-info { order: 2; }
  .ct-map { order: 3; }
}

/* ---------- Card head ---------- */
.ct-card__head { display: flex; align-items: center; gap: .85rem; }
.ct-card__ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
:root[data-theme="dark"] .ct-card__ic { color: #c4a8ff; border: 1px solid rgba(167, 139, 250, .4); }
.ct-card__ic--sm { width: 34px; height: 34px; border-radius: 10px; }
.ct-card__ic--sm .i { width: 18px; height: 18px; }
.ct-card__head h2, .ct-info__head h2, .ct-faq h2 { font-size: 1.15rem; font-weight: 800; color: var(--text-strong); line-height: 1.5; }
.ct-card__head p { margin-top: .15rem; font-size: .82rem; color: var(--muted); line-height: 1.8; }

/* ---------- Ticket form ---------- */
.ct-form-card { padding: clamp(1.1rem, 2.6vw, 1.6rem); }
.ct-form { display: grid; gap: 1rem; margin-top: 1.3rem; }
.ct-field { min-width: 0; }
.ct-field > label, .ct-label { display: block; margin-bottom: .45rem; font-size: .86rem; font-weight: 600; color: var(--text-strong); }
.ct-field > label b { color: var(--red); margin-inline-start: .15rem; }
.ct-label small { font-weight: 400; color: var(--muted); }

.ct-control { position: relative; display: flex; align-items: center; }
.ct-control > .i:first-child { position: absolute; inset-inline-start: .95rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color .15s; }
.ct-control input, .ct-control select, .ct-control textarea {
  width: 100%; min-width: 0; height: 50px; padding: 0 1rem; padding-inline-start: 2.8rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text);
  font: inherit; font-size: max(16px, 1rem); line-height: 1.5; outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
:root[data-theme="dark"] .ct-control input, :root[data-theme="dark"] .ct-control select, :root[data-theme="dark"] .ct-control textarea { background: rgba(21, 18, 54, .7); }
.ct-control input::placeholder, .ct-control textarea::placeholder { color: var(--muted); opacity: .85; }
.ct-control:focus-within > .i:first-child { color: var(--accent); }
.ct-control input:focus, .ct-control select:focus, .ct-control textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-control input[type="tel"] { direction: ltr; text-align: right; padding-left: 1rem; padding-right: 2.8rem; }
.ct-control--area textarea { height: auto; min-height: 130px; padding: .85rem 1rem; resize: vertical; }
.ct-control--select select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.6rem; cursor: pointer; }
.ct-control--select select:invalid { color: var(--muted); }
.ct-control--select select option { color: #0b1633; background: #fff; }
.ct-control__chev { position: absolute; inset-inline-end: .9rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }

.ct-field.has-error .ct-control input, .ct-field.has-error .ct-control select, .ct-field.has-error .ct-control textarea,
.ct-field.has-error .ct-drop { border-color: #ff4d6d; box-shadow: 0 0 0 3px rgba(255, 77, 109, .14); }
.ct-err { margin-top: .4rem; font-size: .8rem; line-height: 1.7; color: #ff4d6d; }
.ct-err[hidden] { display: none; }
.ct-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.ct-meta .ct-err { flex: 1; }
.ct-count { margin-top: .4rem; margin-inline-start: auto; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.ct-count.is-near { color: #f59e0b; }

/* upload */
.ct-drop { position: relative; display: grid; justify-items: center; gap: .25rem; padding: 1.1rem 1rem; text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .78rem; transition: border-color .15s, background .15s, box-shadow .15s; }
:root[data-theme="dark"] .ct-drop { background: rgba(21, 18, 54, .45); }
.ct-drop .i { width: 26px; height: 26px; color: var(--accent); }
:root[data-theme="dark"] .ct-drop .i { color: #b79bff; }
.ct-drop strong { font-size: .86rem; font-weight: 600; color: var(--text-strong); }
.ct-drop u { text-decoration: none; color: var(--accent); }
:root[data-theme="dark"] .ct-drop u { color: #b79bff; }
.ct-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.ct-drop:hover, .ct-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.ct-drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-drop.is-full { opacity: .55; }
.ct-drop.is-full input { cursor: not-allowed; }

.ct-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .6rem; }
.ct-thumbs:empty { display: none; }
.ct-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.ct-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ct-thumb button { position: absolute; top: 6px; inset-inline-start: 6px; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(8, 7, 24, .8); color: #fff; cursor: pointer; transition: background .15s; }
.ct-thumb button:hover { background: #e11d48; }
.ct-thumb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ct-thumb .i { width: 14px; height: 14px; }

/* honeypot */
.ct-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* submit */
.ct-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 52px; margin-top: .2rem;
  border: 0; border-radius: 14px; background: var(--btn-bg); color: var(--on-accent);
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; box-shadow: var(--btn-shadow); transition: transform .18s, filter .18s, opacity .18s;
}
:root[data-theme="dark"] .ct-submit { background: linear-gradient(90deg, #6d28d9, #8b5cf6 55%, #a78bfa); }
.ct-submit .i { width: 20px; height: 20px; transform: scaleX(-1); }
.ct-submit:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.ct-submit:active:not(:disabled) { transform: translateY(0); }
.ct-submit:focus-visible, .ct-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ct-submit:disabled { cursor: progress; opacity: .8; }
.ct-submit.is-loading .i { display: none; }
.ct-submit.is-loading span::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-inline-end: .55rem; vertical-align: -2px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: ct-spin .7s linear infinite; }
@keyframes ct-spin { to { transform: rotate(360deg); } }

.ct-alert { display: flex; align-items: flex-start; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; border: 1px solid rgba(255, 77, 109, .45); background: rgba(255, 77, 109, .1); color: #ff4d6d; font-size: .86rem; line-height: 1.8; }
:root[data-theme="light"] .ct-alert { color: #c81e44; }
.ct-alert[hidden] { display: none; }
.ct-alert .i { width: 20px; height: 20px; margin-top: .15rem; }

/* success */
.ct-done { display: grid; justify-items: center; gap: .6rem; padding: clamp(1.6rem, 5vw, 2.6rem) 1rem; text-align: center; }
.ct-done[hidden], .ct-form[hidden] { display: none; }
.ct-done__ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(34, 197, 94, .14); color: #22c55e; border: 1px solid rgba(34, 197, 94, .4); }
.ct-done__ic .i { width: 30px; height: 30px; stroke-width: 2.2; }
.ct-done h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-strong); outline: 0; }
.ct-done p { max-width: 24rem; font-size: .88rem; line-height: 1.9; color: var(--muted); }
.ct-done__code b { color: var(--text-strong); font-family: var(--latin); letter-spacing: .04em; }

.ct-ghost { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; border: 1px solid var(--accent); border-radius: 99px; background: transparent; color: var(--accent); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
:root[data-theme="dark"] .ct-ghost { color: #c4a8ff; border-color: rgba(167, 139, 250, .6); }
.ct-ghost:hover { background: var(--accent); color: #fff; }
.ct-ghost .i { transition: transform .2s; }
.ct-ghost[aria-pressed="true"] .i { transform: rotate(180deg); }

/* ---------- Map (iframe گوگل) ---------- */
.ct-map { position: relative; min-height: 440px; overflow: hidden; padding: 0; }
.ct-map__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--surface-2); }
/* در تم تاریک نقشه هم تیره می‌شود تا با بقیه‌ی صفحه جور باشد */
:root[data-theme="dark"] .ct-map__frame { filter: invert(92%) hue-rotate(180deg) contrast(.92) saturate(.85); }

.ct-map__card { position: absolute; top: 1rem; right: 1rem; max-width: calc(100% - 2rem); padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="dark"] .ct-map__card { background: rgba(12, 10, 34, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ct-map__card h2 { font-size: .86rem; font-weight: 700; color: var(--text-strong); margin-bottom: .6rem; }
.ct-map__btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border-radius: 10px; background: var(--btn-bg); color: #fff; font-size: .8rem; font-weight: 600; box-shadow: var(--btn-shadow); transition: filter .15s; }
:root[data-theme="dark"] .ct-map__btn { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.ct-map__btn:hover { filter: brightness(1.1); }
.ct-map__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ct-map__btn .i { width: 16px; height: 16px; }


/* ---------- Contact ways ---------- */
.ct-info { display: flex; flex-direction: column; padding: clamp(1.1rem, 2.6vw, 1.5rem); }
.ct-info__head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.ct-ways { display: grid; flex: 1; grid-auto-rows: 1fr; gap: .8rem; }
.ct-ways > li { display: flex; }
.ct-way { flex: 1; min-width: 0; display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
:root[data-theme="dark"] .ct-way { background: rgba(21, 18, 54, .55); }
a.ct-way:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
a.ct-way:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ct-way__ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 13px; background: var(--btn-bg); color: #fff; box-shadow: var(--btn-shadow); }
:root[data-theme="dark"] .ct-way__ic { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.ct-way__ic .i { width: 21px; height: 21px; }
.ct-way__tx { display: grid; gap: .12rem; min-width: 0; }
.ct-way__tx small { font-size: .78rem; color: var(--muted); }
.ct-way__tx strong { font-size: .95rem; font-weight: 700; color: var(--text-strong); overflow-wrap: anywhere; }
.ct-way__tx strong[dir="ltr"] { text-align: right; }
.ct-way__tx em { font-style: normal; font-size: .76rem; line-height: 1.7; color: var(--muted); }

/* ---------- FAQ ---------- */
.ct-faq { margin-top: clamp(1.6rem, 4vw, 2.6rem); padding-top: clamp(1.4rem, 3vw, 2rem); border-top: 1px solid var(--line); }
.ct-faq__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.ct-faq__head h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
.ct-faq__head p { margin-top: .2rem; font-size: .86rem; color: var(--muted); }
.ct-faq__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; align-items: start; }
.ct-faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
:root[data-theme="dark"] .ct-faq details { background: rgba(14, 12, 37, .8); }
.ct-faq details[open] { border-color: var(--accent); box-shadow: var(--shadow); }
.ct-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; font-size: .92rem; font-weight: 600; color: var(--text-strong); cursor: pointer; list-style: none; }
.ct-faq summary::-webkit-details-marker { display: none; }
.ct-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 14px; }
.ct-faq summary .i { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.ct-faq details[open] summary .i { transform: rotate(180deg); color: var(--accent); }
.ct-faq details p { padding: 0 1.1rem 1.1rem; font-size: .86rem; line-height: 2; color: var(--muted); }
.ct-faq details p a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
:root[data-theme="dark"] .ct-faq details p a { color: #b79bff; }
.ct-faq__empty { grid-column: 1 / -1; padding: 1rem 1.1rem; border: 1px dashed var(--line); border-radius: 14px; font-size: .86rem; line-height: 2; color: var(--muted); text-align: center; }
.ct-faq__empty[hidden] { display: none; }

@media (max-width: 719px) { .ct-faq__list { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Small screens ---------- */
@media (max-width: 719px) {
  .ct-hero__bg { background-position: 15% center; }
  .ct-hero__bg::after { background: linear-gradient(to left, rgba(5, 4, 26, .96) 0, rgba(5, 4, 26, .86) 55%, rgba(5, 4, 26, .6) 100%); }
  .ct-feats { gap: .8rem 1.2rem; }
  .ct-map { min-height: 340px; }
}
@media (max-width: 479px) {
  .ct-feats li { flex: 1 1 100%; }
  .ct-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-map__card { left: .75rem; right: .75rem; top: .75rem; max-width: none; }
  .ct-faq__head .ct-ghost { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-submit, .ct-way, .ct-ghost .i, .ct-faq summary .i { transition: none; }
  .ct-submit.is-loading span::before { animation-duration: 1.6s; }
}
