/* ==========================================================================
   The contact page: a calm two-column layout, the form in one card, the
   ways to reach us and what happens next beside it.
   ========================================================================== */

.ct-hero { padding: 6rem 0 2.5rem; text-align: center; }
.ct-hero .wrap { display: flex; flex-direction: column; align-items: center; }
.ct-title {
  max-width: 22ch; margin: 1rem auto 0; font-size: clamp(2.25rem, 5.2vw, 3.75rem); font-weight: 700;
  letter-spacing: -0.045em; line-height: 1.08; text-wrap: balance;
  background: linear-gradient(180deg, hsl(var(--foreground)) 35%, hsl(var(--foreground) / .66));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[dir="rtl"] .ct-title { line-height: 1.35; letter-spacing: 0; }
.ct-sub { max-width: 40rem; margin: 1.125rem auto 0; font-size: 1.0625rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }
.ct-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.ct-chips li {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.875rem; border-radius: 999px;
  font-size: 0.875rem; background: hsl(var(--card) / .75); border: 1px solid hsl(var(--border)); backdrop-filter: blur(8px);
}
.ct-chips .icon { width: 1rem; height: 1rem; color: hsl(var(--primary)); }

.ct-main { padding: 1.5rem 0 6rem; border: 0; }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }

.ct-card {
  position: relative; padding: 1.75rem; border-radius: 1.375rem;
  background: linear-gradient(180deg, hsl(var(--card)), hsl(var(--card) / .82));
  border: 1px solid hsl(var(--border)); box-shadow: inset 0 1px 0 hsl(0 0% 100% / .03);
}
.ct-card h3 { margin: 0 0 1.125rem; font-size: 1.0625rem; letter-spacing: -0.015em; }
.ct-form-card { padding: 2rem; }
.ct-form-card::before {
  content: ""; position: absolute; inset: -1px -1px auto; height: 1px; border-radius: inherit;
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / .7), transparent);
}

/* -------------------------------------------------------------- the form */
.ct-form { display: grid; gap: 2rem; }
.ct-set { margin: 0; padding: 0; border: 0; display: grid; gap: 1.125rem; min-width: 0; }
.ct-set legend { display: flex; align-items: center; gap: 0.625rem; padding: 0; margin-bottom: 1.125rem; font-size: 1rem; font-weight: 600; }
.ct-step {
  display: inline-grid; place-items: center; flex: none; width: 1.625rem; height: 1.625rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; color: hsl(var(--primary)); background: hsl(var(--primary) / .12); border: 1px solid hsl(var(--primary) / .3);
}
.ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ct-field { display: grid; gap: 0.5rem; min-width: 0; align-content: start; }
.ct-field > label, .ct-label { font-size: 0.875rem; font-weight: 550; }
.ct-field > label i { font-style: normal; color: hsl(var(--primary)); }
.ct-field input:not([type="file"]), .ct-field textarea {
  width: 100%; padding: 0.8125rem 0.9375rem; border-radius: 0.75rem; font: inherit; font-size: 0.9375rem;
  color: hsl(var(--foreground)); background: hsl(var(--background) / .7); border: 1px solid hsl(var(--input));
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ct-field textarea { min-height: 10rem; resize: vertical; line-height: 1.65; }
.ct-field input::placeholder, .ct-field textarea::placeholder { color: hsl(var(--muted-foreground) / .7); }
.ct-field input:focus, .ct-field textarea:focus {
  outline: none; border-color: hsl(var(--primary) / .7); background: hsl(var(--background));
  box-shadow: 0 0 0 4px hsl(var(--primary) / .14);
}
.ct-field small { font-size: 0.78rem; color: hsl(var(--muted-foreground)); line-height: 1.5; }
.ct-field.bad input, .ct-field.bad textarea { border-color: hsl(var(--destructive, 0 72% 51%) / .8); }
.ct-err { margin: 0; font-size: 0.8125rem; color: hsl(var(--destructive, 0 72% 51%)); }
.ct-under { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.ct-count { font-size: 0.75rem; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-count.near { color: hsl(var(--warning, 38 92% 50%)); }

.ct-topics { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ct-topic {
  padding: 0.5rem 0.875rem; border-radius: 999px; font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  color: hsl(var(--foreground) / .85); background: hsl(var(--secondary) / .6); border: 1px solid hsl(var(--border));
  transition: border-color .15s, background .15s, color .15s;
}
.ct-topic:hover { border-color: hsl(var(--primary) / .45); }
.ct-topic[aria-pressed="true"] { color: hsl(var(--primary)); background: hsl(var(--primary) / .12); border-color: hsl(var(--primary) / .55); }
.ct-topic:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

/* the drop area */
.ct-drop {
  position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: 0.875rem; cursor: pointer;
  border: 1.5px dashed hsl(var(--border)); background: hsl(var(--background) / .45); transition: border-color .15s, background .15s;
}
.ct-drop:hover, .ct-drop.over { border-color: hsl(var(--primary) / .6); background: hsl(var(--primary) / .06); }
.ct-drop:focus-within { border-color: hsl(var(--primary) / .7); box-shadow: 0 0 0 4px hsl(var(--primary) / .12); }
.ct-drop-ic { flex: none; width: 2.5rem; height: 2.5rem; padding: 0.625rem; border-radius: 0.75rem; color: hsl(var(--primary)); background: hsl(var(--primary) / .1); }
.ct-drop > span { display: grid; gap: 0.25rem; }
.ct-drop b { font-weight: 500; font-size: 0.9375rem; }
.ct-drop u { color: hsl(var(--primary)); text-underline-offset: 3px; }
.ct-drop small { font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.ct-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ct-files { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.ct-files li {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.5rem 0.5rem 0.875rem; border-radius: 0.625rem;
  background: hsl(var(--secondary) / .5); border: 1px solid hsl(var(--border)); font-size: 0.8125rem;
}
html[dir="rtl"] .ct-files li { padding: 0.5rem 0.875rem 0.5rem 0.5rem; }
.ct-files li.bad { border-color: hsl(var(--destructive, 0 72% 51%) / .6); }
.ct-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.ct-file-size { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.ct-file-x {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 0.5rem; cursor: pointer;
  color: hsl(var(--muted-foreground)); background: transparent; border: 0;
}
.ct-file-x:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.ct-file-x .icon { width: 1rem; height: 1rem; }

.ct-alert {
  padding: 1rem 1.125rem; border-radius: 0.875rem; font-size: 0.875rem;
  color: hsl(var(--destructive, 0 72% 51%)); background: hsl(var(--destructive, 0 72% 51%) / .08); border: 1px solid hsl(var(--destructive, 0 72% 51%) / .3);
}
.ct-alert ul { margin: 0.375rem 0 0; padding-inline-start: 1.125rem; }

.ct-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-top: 1.5rem; border-top: 1px solid hsl(var(--border)); }
.ct-privacy { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0; max-width: 26rem; font-size: 0.8125rem; line-height: 1.55; color: hsl(var(--muted-foreground)); }
.ct-privacy .icon { flex: none; width: 1rem; height: 1rem; margin-top: 0.1875rem; color: hsl(var(--teal)); }
.ct-send { flex: none; height: 3rem; padding: 0 1.5rem; gap: 0.625rem; font-size: 0.9375rem; }
.ct-send.busy { opacity: .75; cursor: progress; }

/* sent */
.ct-done { display: grid; justify-items: center; gap: 0.875rem; padding: 2.5rem 1rem; text-align: center; }
.ct-done-ic { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 999px; color: hsl(var(--teal)); background: hsl(var(--teal) / .12); border: 1px solid hsl(var(--teal) / .35); }
.ct-done-ic .icon { width: 2.25rem; height: 2.25rem; }
.ct-done h2 { margin: 0.5rem 0 0; font-size: 1.75rem; letter-spacing: -0.03em; }
.ct-done p { max-width: 28rem; margin: 0 0 0.75rem; color: hsl(var(--muted-foreground)); line-height: 1.65; }

/* -------------------------------------------------------------- the side */
.ct-side { display: grid; gap: 1.25rem; }
.ct-ic {
  display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem;
  color: hsl(var(--primary)); background: hsl(var(--primary) / .1); border: 1px solid hsl(var(--primary) / .2);
}
.ct-ic .icon { width: 1.0625rem; height: 1.0625rem; }
.ct-direct { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.ct-direct li { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.ct-direct a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: hsl(var(--foreground)); text-align: start; }
.ct-direct a:hover { color: hsl(var(--primary)); }
.ct-copy {
  display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 0.5rem; cursor: pointer;
  color: hsl(var(--muted-foreground)); background: hsl(var(--secondary) / .6); border: 1px solid hsl(var(--border));
}
.ct-copy:hover { color: hsl(var(--foreground)); }
.ct-copy.copied { color: hsl(var(--teal)); border-color: hsl(var(--teal) / .5); }
.ct-copy .icon { width: 0.9375rem; height: 0.9375rem; }

.ct-next { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.ct-next li { display: flex; gap: 0.875rem; align-items: flex-start; }
.ct-next p { margin: 0.125rem 0 0; font-size: 0.875rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }

.ct-links { display: grid; gap: 0.25rem; margin: 0 -0.625rem; }
.ct-links a {
  display: flex; align-items: center; gap: 0.875rem; padding: 0.75rem 0.625rem; border-radius: 0.75rem;
  color: hsl(var(--foreground)); text-decoration: none; transition: background .15s;
}
.ct-links a:hover { background: hsl(var(--accent) / .7); }
.ct-links a > span:nth-child(2) { display: grid; gap: 0.125rem; flex: 1; min-width: 0; }
.ct-links b { font-weight: 550; font-size: 0.9375rem; }
.ct-links small { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.ct-go { width: 1rem; height: 1rem; color: hsl(var(--muted-foreground)); transition: transform .15s, color .15s; }
.ct-links a:hover .ct-go { color: hsl(var(--primary)); transform: translateX(3px); }
html[dir="rtl"] .ct-links a:hover .ct-go { transform: scaleX(-1) translateX(3px); }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* right-to-left pages set [dir=ltr] in monospace; here they keep the normal font */
html[dir="rtl"] .ct-chips [dir="ltr"], html[dir="rtl"] .ct-direct [dir="ltr"], html[dir="rtl"] .ct-count { font-family: var(--font-sans); }
html[dir="rtl"] .ct-field input[dir="ltr"] { font-family: var(--font-sans); text-align: left; }

@media (max-width: 64rem) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-side { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}
@media (max-width: 40rem) {
  .ct-hero { padding: 4rem 0 1.5rem; }
  .ct-form-card { padding: 1.375rem; }
  .ct-row { grid-template-columns: minmax(0, 1fr); }
  .ct-foot { flex-direction: column; align-items: stretch; }
  .ct-send { width: 100%; justify-content: center; }
}
