/* Albasheer Show public site. Design tokens and fonts from the client questionnaire (questionnaire/web/page.css):
   Tajawal (OFL, bundled), red #B20000 with a #E50000→#7F0000 gradient, light grey page, white cards (radius 24px),
   gradient pill buttons. Logical properties throughout so the layout mirrors in Arabic. Same-origin only (CSP). */

@font-face {
  font-family: "Tajawal";
  src: url("tajawal-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  ascent-override: 92%;
  descent-override: 28%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Tajawal";
  src: url("tajawal-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  ascent-override: 92%;
  descent-override: 28%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Tajawal";
  src: url("tajawal-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  ascent-override: 92%;
  descent-override: 28%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Tajawal Arabic";
  src: url("tajawal-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  ascent-override: 84%;
  descent-override: 36%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Tajawal Arabic";
  src: url("tajawal-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  ascent-override: 84%;
  descent-override: 36%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Tajawal Arabic";
  src: url("tajawal-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  ascent-override: 84%;
  descent-override: 36%;
  line-gap-override: 0%;
}

:root {
  --red: #b20000;
  --red-light: #e50000;
  --red-dark: #7f0000;
  --orange-light: #ffab74;
  --orange-dark: #fe6c0f;
  --orange: #ff8c42;
  --page: #f3f3f3;
  --card-bg: #ffffff;
  --ink: #55504c;
  --ink-strong: #3a3633;
  --ink-soft: #6f6964;
  --line: #e5e7eb;
  --line-strong: #c8ccd4;
  --night: #140000;
  --ok: #1a9949;
  --ok-text: #146b34;
  --control-line: #8c8580;
  --r-card: 24px;
  --r-field: 20px;
  --font-body: "Tajawal", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
:lang(ar) {
  --font-body: "Tajawal Arabic", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: the hidden attribute must win over component display rules */
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 400 16px / 1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
html[data-lang="ar"] body {
  font-size: 17px;
  line-height: 1.75;
}
main {
  flex: 1;
  padding-block: clamp(16px, 4vw, 40px);
}
h1,
h2,
h3 {
  color: var(--ink-strong);
  font-weight: 500;
  margin: 0 0 12px;
  line-height: 1.25;
}
p {
  margin: 0 0 12px;
}
a {
  color: var(--red);
}
.wrap {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: clamp(14px, 4vw, 48px);
}
.card {
  background: var(--card-bg);
  border-radius: var(--r-card);
  box-shadow:
    0 1px 2px rgb(20 0 0 / 0.04),
    0 8px 24px -12px rgb(20 0 0 / 0.1);
}
.muted {
  color: var(--ink-soft);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  background: var(--red);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 50;
}
.skip:focus {
  top: 12px;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 55%, white);
  outline-offset: 2px;
}
bdi[dir="ltr"],
.refcode {
  font-family: "Tajawal", system-ui, sans-serif;
}

/* ---------- top bar & footer ---------- */
.topbar {
  background: #fff;
  border-block-end: 1px solid var(--line);
}
.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-strong);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.brand img {
  width: 36px;
  height: 36px;
}
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: #7a4d00;
  background: #fff7e8;
  border: 1px solid #f7d9a0;
  border-radius: 999px;
  padding: 2px 10px;
}
.lang-link {
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--page);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.lang-link:hover {
  background: #fff0ee;
  color: var(--red-dark);
}
.footer {
  background: var(--night);
  color: #e9dcdc;
  font-size: 0.9rem;
  padding-block: 18px;
}
.footer p {
  margin: 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font: 500 1rem var(--font-body);
  line-height: 1.5rem;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(to right, var(--red-light), var(--red-dark));
  border: 1px solid var(--red);
  transition:
    filter 0.25s,
    box-shadow 0.25s;
  min-height: 48px;
}
html[dir="rtl"] .btn {
  background: linear-gradient(to left, var(--red-light), var(--red-dark));
}
.btn:hover {
  background: linear-gradient(to right, var(--orange-light), var(--orange-dark));
  border-color: var(--orange);
  box-shadow: 0 10px 24px -10px rgb(254 108 15 / 0.7);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn-ghost,
html[dir="rtl"] .btn-ghost {
  background: #fff;
  color: var(--red);
}
.btn-ghost:hover {
  color: #fff;
}
.btn-big {
  font-size: 1.15rem;
  padding: 16px 36px;
}
.btn-plain {
  font: 500 0.95rem var(--font-body);
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-strong);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  min-height: 40px;
}
.btn-plain:hover {
  border-color: var(--red);
  color: var(--red-dark);
}
.link {
  font-weight: 500;
}
.icon-btn {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn[aria-expanded="true"],
.icon-btn:hover {
  border-color: var(--red);
  color: var(--red);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- character ---------- */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-light), var(--red-dark));
  flex: none;
}
.avatar img {
  width: 62%;
  height: auto;
  filter: brightness(0) invert(1);
}
.avatar-sm {
  width: 52px;
  height: 52px;
}
.avatar-lg {
  width: 128px;
  height: 128px;
}
.avatar-live::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--red) 40%, transparent);
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}
.character {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: clamp(20px, 4vw, 36px);
}
.character-name {
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 1.2rem;
  margin: 6px 0 0;
}
.bubble {
  background: var(--page);
  border-radius: 18px;
  padding: 10px 18px;
  margin: 0;
}
.dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.dots i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-live::after,
  .dots i {
    animation: none;
  }
}

/* ---------- landing ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding-block: clamp(8px, 3vw, 32px);
}
.kicker {
  color: var(--red);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.15;
  font-weight: 700;
}
html[data-lang="ar"] .hero h1 {
  line-height: 1.35;
}
.lead {
  font-size: 1.15rem;
  color: var(--ink);
  margin: 16px 0 26px;
}
.disclosure {
  text-align: start;
  margin-block-start: 12px;
  padding: 14px 18px;
  border-inline-start: 4px solid var(--red);
  background: #fff5f2;
  border-radius: 0 var(--r-field) var(--r-field) 0;
  color: var(--ink-strong);
}
html[dir="rtl"] .disclosure {
  border-radius: var(--r-field) 0 0 var(--r-field);
}
.disclosure h2 {
  font-size: 1rem;
  color: var(--red-dark);
  margin: 0 0 4px;
  font-weight: 700;
}
.disclosure p {
  margin: 0;
  font-size: 0.95rem;
}
.info {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-block-start: 28px;
}
.info-card {
  padding: clamp(20px, 3vw, 32px);
}
.steps {
  margin: 0;
  padding-inline-start: 1.3em;
  display: grid;
  gap: 8px;
}
.steps li::marker {
  color: var(--red);
  font-weight: 700;
}

/* ---------- chat ---------- */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.chat {
  display: flex;
  flex-direction: column;
  min-height: min(78vh, 760px);
  padding: 0;
  overflow: hidden;
}
.chat-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-block-end: 1px solid var(--line);
}
.chat-head h1 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
}
.chat-sub {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.empty {
  margin: 24px 20px 0;
  padding: 14px 18px;
  border-radius: var(--r-field);
  background: var(--page);
  color: var(--ink-soft);
}
.messages {
  list-style: none;
  margin: 0;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 62vh;
}
.msg {
  max-width: min(85%, 560px);
  padding: 10px 14px 6px;
  border-radius: 18px;
  background: var(--page);
  align-self: flex-start;
  display: grid;
  gap: 2px;
}
.msg-visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, #fff0ee, #ffe4df);
}
.msg-team {
  background: #eaf7ef;
  border: 1px solid #cdebd8;
}
.msg-author {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red-dark);
}
.msg-team .msg-author {
  color: var(--ok-text);
}
.msg-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-strong);
}
.msg-time {
  font-size: 0.72rem;
  color: var(--ink-soft);
  justify-self: end;
}
.msg-files {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.typing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.composer {
  border-block-start: 1px solid var(--line);
  padding: 12px 16px 16px;
  display: grid;
  gap: 8px;
}
.composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
textarea,
input[type="text"] {
  width: 100%;
  font: inherit;
  line-height: 1.6;
  color: var(--ink-strong);
  background: #fcfcfb;
  border: 1px solid var(--control-line);
  border-radius: var(--r-field);
  padding: 10px 14px;
  resize: none;
  min-height: 48px;
}
.composer textarea {
  flex: 1;
  min-width: 0;
}
textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(178 0 0 / 0.1);
}
.upload-panel {
  background: #fff7e8;
  border: 1px solid #f7d9a0;
  border-radius: var(--r-field);
  padding: 14px 16px;
  color: #5c3a00;
}
.upload-panel h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #7a4d00;
  margin: 0 0 6px;
}
.upload-panel p {
  font-size: 0.93rem;
}
.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  max-width: 100%;
}
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.file-remove {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fdecec;
  color: var(--red-dark);
  font-size: 0.93rem;
}
.side {
  display: grid;
  gap: 14px;
}
.side-card {
  padding: 18px 20px;
  display: grid;
  gap: 8px;
}
.side-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.side-card p {
  margin: 0;
  font-size: 0.92rem;
}
.side-link {
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  color: var(--red);
}
.contact {
  border: 2px solid var(--red);
}
.saved {
  color: var(--ok-text);
  background: #eaf7ef;
}

/* ---------- reference code ---------- */
.refcard {
  margin: 0 16px 12px;
  padding: 18px 20px;
  border-radius: var(--r-field);
  background: #fff;
  border: 2px dashed var(--red);
  display: grid;
  gap: 8px;
  text-align: center;
  justify-items: center;
}
.refcard h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.refcode {
  margin: 0;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--red-dark);
  user-select: all;
}

/* ---------- forms pages ---------- */
.narrow {
  max-width: 560px;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 36px);
  display: grid;
  gap: 12px;
}
.narrow form {
  display: grid;
  gap: 12px;
}
.narrow input[type="text"] {
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-align: center;
}
label {
  font-weight: 500;
  color: var(--ink-strong);
}

/* ---------- voice ---------- */
.voice {
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(24px, 5vw, 44px);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
}
.voice h1 {
  margin: 10px 0 0;
  font-weight: 700;
}
.voice .avatar-live::after {
  animation-duration: 3s;
}
.voice[data-state="speaking"] .avatar-live::after {
  animation-duration: 0.9s;
  border-color: color-mix(in srgb, var(--orange) 70%, transparent);
}
.voice[data-state="listening"] .avatar-live::after {
  animation-duration: 1.6s;
}
.voice-notice {
  text-align: start;
  background: #fff5f2;
  border-radius: var(--r-field);
  padding: 16px 20px;
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
}
.voice-notice h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--red-dark);
  margin: 0;
  justify-self: start;
}
.voice-notice ul {
  margin: 0;
  padding-inline-start: 1.2em;
  display: grid;
  gap: 6px;
  justify-self: stretch;
}
.voice-notice li::marker {
  color: var(--red);
}
.voice-live {
  width: 100%;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.voice-status {
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0;
}
.captions {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: start;
}
.caption {
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--page);
  display: grid;
}
.caption-user {
  background: #fff0ee;
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero,
  .info,
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .character {
    order: -1;
  }
  .avatar-lg {
    width: 96px;
    height: 96px;
  }
  .messages {
    max-height: none;
  }
  .chat {
    min-height: 70vh;
  }
}
@media (max-width: 480px) {
  .btn {
    padding: 12px 20px;
  }
  .actions .btn {
    flex: 1 1 100%;
  }
  .msg {
    max-width: 92%;
  }
  .composer-row .btn {
    padding-inline: 16px;
  }
}
