:root {
  --navy: #003b73;
  --navy-dark: #002e5a;
  --gold: #d4af37;
  --gold-dark: #aa8617;
  --terra: #b85c38;
  --ink: #17202a;
  --muted: #5b6672;
  --line: #dfe5ec;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --soft-blue: #edf4fc;
  --success: #178653;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 8%, rgba(212, 175, 55, 0.12), transparent 28rem),
    linear-gradient(180deg, #fff 0%, #f6f8fb 100%);
  font-family: Inter, Cairo, sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.site-header {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.site-header-inner {
  width: min(1180px, calc(100% - 2rem));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 42px;
  height: 42px;
}

.brand span {
  white-space: nowrap;
  font-size: 1rem;
  font-style: normal;
  font-weight: 800;
}

.brand b {
  color: var(--terra);
}

.brand i {
  color: var(--gold);
  font-style: normal;
}

.brand em {
  color: #806d55;
  font-style: normal;
}

.site-nav {
  display: flex;
  gap: 1.7rem;
}

.site-nav a {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.site-controls {
  display: flex;
  gap: 0.2rem;
}

.language-button {
  min-width: 38px;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.language-button.is-active {
  color: var(--gold-dark);
  background: #fff7dc;
}

#consultation-app {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.welcome-view {
  width: min(720px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.welcome-agent {
  width: 132px;
  height: 132px;
  margin-bottom: 1.3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 32px;
  background: linear-gradient(145deg, #fff9e8, #fff);
  box-shadow: 0 18px 45px rgba(28, 54, 82, 0.1);
  transform: rotate(45deg);
}

.agent-face {
  width: 78px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 7px solid var(--navy);
  border-radius: 24px;
  background: #fff;
  transform: rotate(-45deg);
}

.agent-face::before {
  position: absolute;
  width: 4px;
  height: 21px;
  margin-top: -76px;
  border-radius: 4px;
  background: var(--navy);
  content: "";
}

.agent-face::after {
  position: absolute;
  width: 13px;
  height: 13px;
  margin-top: -99px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px #fff;
  content: "";
}

.agent-face i {
  width: 10px;
  height: 13px;
  border-radius: 50%;
  background: var(--navy);
}

.welcome-kicker {
  margin-bottom: 0.7rem;
  color: var(--terra);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.welcome-view h1 {
  max-width: 680px;
  margin-bottom: 1rem;
  color: var(--navy-dark);
  font-size: clamp(2.15rem, 5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.welcome-lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.capability-row {
  margin: 1.7rem 0;
  display: flex;
  justify-content: center;
  gap: 0;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
}

.capability-row span {
  padding: 0 1rem;
  border-inline-end: 1px solid var(--line);
}

.capability-row span:last-child {
  border-inline-end: 0;
}

.welcome-actions {
  width: min(460px, 100%);
  display: grid;
  gap: 0.65rem;
}

.primary-button,
.secondary-button,
.outline-button {
  min-height: 52px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--gold);
  color: #102a43;
  box-shadow: 0 10px 25px rgba(166, 128, 13, 0.2);
}

.primary-button:hover {
  background: #e1bb38;
}

.primary-button:disabled {
  background: #d9dde2;
  color: #7c8792;
  cursor: not-allowed;
  box-shadow: none;
}

.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font-weight: 700;
}

.analytics-choice {
  max-width: 620px;
  margin-top: 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: left;
}

.analytics-choice input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--navy);
  flex-shrink: 0;
}

.privacy-warning {
  max-width: 600px;
  margin-top: 0.6rem;
  color: #7d5d52;
  font-size: 0.68rem;
}

.agent-shell {
  min-height: calc(100vh - 72px);
  padding: 2rem 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 1.25rem;
}

.answer-sidebar,
.agent-workspace {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(25, 48, 72, 0.08);
}

.answer-sidebar {
  min-height: 660px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-heading strong {
  color: var(--navy-dark);
  font-size: 0.95rem;
}

.sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  cursor: pointer;
  font-size: 1.4rem;
}

.progress-track,
.mobile-progress-track {
  overflow: hidden;
  border-radius: 999px;
  background: #e6eaf0;
}

.progress-track {
  height: 7px;
  margin: 0.8rem 0 1.2rem;
}

.progress-track span,
.mobile-progress-track i {
  display: block;
  width: 5%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.25s ease;
}

.answer-list {
  display: grid;
  gap: 0.65rem;
}

.answer-item {
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}

.answer-item button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
}

.answer-item p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-privacy {
  margin-top: auto;
  padding-top: 1rem;
  display: grid;
  gap: 0.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.sidebar-privacy strong {
  color: var(--navy);
}

.agent-workspace {
  min-width: 0;
  min-height: 660px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-toolbar {
  min-height: 70px;
  padding: 0.75rem 1.2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.agent-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mini-agent {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
}

.agent-identity strong {
  display: block;
  color: var(--navy-dark);
  font-size: 0.88rem;
}

.agent-identity small {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--success);
  font-size: 0.68rem;
}

.agent-identity small i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #24a66a;
}

.summary-toggle,
.restart-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.summary-toggle {
  visibility: hidden;
  justify-self: start;
}

.restart-button {
  justify-self: end;
}

.step-progress-mobile {
  display: none;
}

.workspace-content {
  flex: 1;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
}

.step-view {
  width: min(760px, 100%);
  margin: auto;
}

.step-number {
  margin-bottom: 0.55rem;
  color: var(--gold-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.step-view h2 {
  margin-bottom: 0.55rem;
  color: var(--navy-dark);
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 1.17;
  letter-spacing: -0.035em;
}

.step-helper {
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.response-timing {
  width: fit-content;
  margin: -0.75rem 0 1.15rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--soft-blue);
  color: #50657a;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.option-card {
  min-height: 92px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.option-card:hover {
  transform: translateY(-1px);
  border-color: #9bb4ce;
}

.option-card.is-selected {
  border-color: var(--navy);
  background: var(--soft-blue);
  box-shadow: 0 0 0 2px rgba(0, 59, 115, 0.08);
}

.option-marker {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1.5px solid #aab5c0;
  border-radius: 50%;
  color: transparent;
  font-size: 0.75rem;
  font-weight: 900;
}

.option-card.is-selected .option-marker {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.option-copy strong {
  display: block;
  color: var(--navy-dark);
  font-size: 0.88rem;
}

.option-copy span {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.custom-answer {
  margin-top: 1rem;
}

.custom-answer label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--navy-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.custom-answer textarea,
.text-answer,
.contact-grid input {
  width: 100%;
  border: 1.5px solid #c6d0da;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}

.custom-answer textarea,
.text-answer {
  min-height: 96px;
  padding: 0.75rem 0.85rem;
  resize: vertical;
}

.custom-answer textarea:focus,
.text-answer:focus,
.contact-grid input:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.13);
}

.step-actions {
  margin-top: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.step-actions .primary-button,
.step-actions .outline-button {
  min-width: 160px;
  padding: 0 1.3rem;
}

.outline-button {
  border: 1.5px solid var(--navy);
  background: #fff;
  color: var(--navy);
}

.early-action {
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: underline;
}

.error-message {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  background: #fff0ef;
  color: #a12d26;
  font-size: 0.76rem;
  font-weight: 700;
}

.recommendation-card {
  display: grid;
  gap: 1rem;
}

.recommendation-heading {
  padding: 1.25rem;
  border: 1px solid #c9d8e8;
  border-radius: 15px;
  background: linear-gradient(145deg, #f3f8fe, #fff);
}

.recommendation-heading h2 {
  margin-bottom: 0.45rem;
  color: var(--navy-dark);
  font-size: 1.7rem;
}

.recommendation-heading p {
  color: var(--muted);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.workflow-step {
  position: relative;
  min-height: 92px;
  padding: 0.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.recommendation-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.recommendation-section,
.metric-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.recommendation-section h3,
.metric-card span {
  margin-bottom: 0.45rem;
  color: var(--navy);
  font-size: 0.76rem;
}

.recommendation-section ul {
  padding-inline-start: 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.recommendation-section li + li {
  margin-top: 0.3rem;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.metric-card strong {
  display: block;
  color: var(--navy-dark);
  font-size: 1.05rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
}

.recommendation-disclaimer {
  color: var(--muted);
  font-size: 0.7rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.contact-field {
  display: grid;
  gap: 0.3rem;
}

.contact-field label {
  color: var(--navy-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.contact-grid input {
  min-height: 46px;
  padding: 0.6rem 0.7rem;
}

.contact-consent {
  margin-top: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.contact-consent input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--navy);
}

.meeting-grid,
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.meeting-button,
.slot-button {
  min-height: 62px;
  padding: 0.65rem;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.meeting-button.is-selected,
.slot-button.is-selected {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.slot-date {
  margin: 1rem 0 0.55rem;
  color: var(--navy-dark);
  font-size: 0.82rem;
}

.confirmation-view {
  text-align: center;
}

.confirmation-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f7ef;
  color: var(--success);
  font-size: 2rem;
  font-weight: 900;
}

.confirmation-details {
  width: min(480px, 100%);
  margin: 1rem auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 0.8rem;
  background: rgba(246, 248, 251, 0.86);
  backdrop-filter: blur(5px);
  color: var(--navy);
  text-align: center;
}

.loading-agent {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.loading-agent span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  animation: loading-bounce 1s infinite ease-in-out;
}

.loading-agent span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-agent span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loading-bounce {
  0%,
  70%,
  100% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-7px);
  }
}

[dir="rtl"] body {
  font-family: Cairo, Inter, sans-serif;
}

[dir="rtl"] .option-card,
[dir="rtl"] .answer-item button,
[dir="rtl"] .analytics-choice {
  text-align: right;
}

@media (max-width: 800px) {
  body.agent-active {
    overflow: hidden;
    background: #fff;
  }

  .site-header-inner {
    min-height: 60px;
  }

  .site-nav {
    display: none;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand span {
    font-size: 0.78rem;
  }

  .brand i,
  .brand em {
    display: none;
  }

  body.agent-active .site-header {
    display: none;
  }

  #consultation-app {
    width: min(100% - 1.25rem, 1180px);
  }

  body.agent-active #consultation-app {
    width: 100%;
    height: 100dvh;
  }

  .welcome-view {
    min-height: calc(100vh - 60px);
    padding: 2.5rem 0;
  }

  .welcome-agent {
    width: 108px;
    height: 108px;
  }

  .agent-face {
    width: 67px;
    height: 50px;
  }

  .welcome-view h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .welcome-lead {
    font-size: 0.94rem;
  }

  .capability-row {
    width: 100%;
    font-size: 0.68rem;
  }

  .capability-row span {
    flex: 1;
    padding: 0 0.5rem;
  }

  .agent-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    display: block;
  }

  .agent-workspace {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .agent-toolbar {
    min-height: 62px;
    padding: 0.55rem 0.75rem;
  }

  .summary-toggle {
    visibility: visible;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .restart-button {
    font-size: 0.68rem;
  }

  .step-progress-mobile {
    padding: 0.45rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    font-size: 0.68rem;
    font-weight: 800;
  }

  .mobile-progress-track {
    height: 5px;
    flex: 1;
  }

  .answer-sidebar {
    position: fixed;
    inset: 0;
    z-index: 90;
    min-height: 0;
    border: 0;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  [dir="rtl"] .answer-sidebar {
    transform: translateX(105%);
  }

  .answer-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .workspace-content {
    min-height: 0;
    overflow-y: auto;
    padding: 1.2rem 0.85rem calc(1.2rem + env(safe-area-inset-bottom));
  }

  .step-view {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  .step-number {
    display: none;
  }

  .step-view h2 {
    font-size: 1.65rem;
  }

  .step-helper {
    margin-bottom: 1rem;
    font-size: 0.85rem;
  }

  .option-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .option-card {
    min-height: 72px;
    padding: 0.75rem;
  }

  .custom-answer textarea,
  .text-answer {
    min-height: 82px;
  }

  .step-actions {
    position: sticky;
    bottom: -1.2rem;
    z-index: 5;
    margin-top: auto;
    padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 20%);
  }

  .step-actions .primary-button,
  .step-actions .outline-button {
    min-width: 0;
    flex: 1;
  }

  .early-action {
    max-width: 130px;
  }

  .workflow {
    grid-template-columns: 1fr 1fr;
  }

  .recommendation-columns,
  .metric-row,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .meeting-grid {
    grid-template-columns: 1fr;
  }

  .slot-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .brand span {
    display: none;
  }

  .welcome-view h1 {
    font-size: 1.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
