* {
  box-sizing: border-box;
}

:root {
  --ink: #172b33;
  --text: #52666e;
  --teal: #116466;
  --teal-dark: #0b4d50;
  --gold: #c9952e;
  --gold-soft: #fff0bd;
  --cream: #fffaf0;
  --blue: #edf6ff;
  --mint: #eaf8f1;
  --purple: #f3efff;
  --line: rgba(17,100,102,.16);
  --container: 1240px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    "IBM Plex Sans Arabic",
    Arial,
    sans-serif;

  color: var(--ink);

  background:
    radial-gradient(
      circle at 10% 15%,
      rgba(201,149,46,.10),
      transparent 28%
    ),
    radial-gradient(
      circle at 90% 20%,
      rgba(17,100,102,.10),
      transparent 28%
    ),
    linear-gradient(
      145deg,
      #fffdf7,
      #f3f9ff
    );
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.main-container {
  width: min(calc(100% - 36px), var(--container));
  margin-inline: auto;
}


/* =========================================
   Loader
   ========================================= */

.ai-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: grid;
  place-items: center;

  padding: 20px;

  background: #f7fbfa;
}

.ai-loader-card {
  width: min(100%, 380px);

  padding: 36px 28px;

  border: 1px solid var(--line);
  border-radius: 28px;

  background: #fff;

  text-align: center;

  box-shadow:
    0 24px 65px rgba(23,43,51,.12);
}

.ai-loader-card > span {
  display: block;
  margin-bottom: 12px;
  font-size: 45px;
}

.ai-loader-card strong {
  display: block;
  font-size: 20px;
}

.ai-loader-card small {
  display: block;
  margin-top: 7px;
  color: var(--text);
}


/* =========================================
   Header
   ========================================= */

.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  border-bottom: 1px solid var(--line);

  background: rgba(255,255,255,.94);

  backdrop-filter: blur(16px);

  box-shadow:
    0 8px 30px rgba(23,43,51,.05);
}

.header-inner {
  min-height: 82px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.main-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;

  text-decoration: none;
}

.brand-symbol {
  width: 50px;
  height: 50px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(201,149,46,.35);
  border-radius: 17px;

  background:
    linear-gradient(
      145deg,
      #fff8dd,
      #edf8f4
    );

  font-size: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 20px;
}

.brand-text b {
  padding: 2px 7px;

  border-radius: 7px;

  background:
    linear-gradient(
      135deg,
      #815d17,
      #c9952e
    );

  color: #fff7d7;
  font-size: 13px;
}

.brand-text small {
  margin-top: 2px;

  color: var(--text);

  font-size: 11px;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mandatory-badge,
.dashboard-link {
  min-height: 43px;

  display: inline-flex;
  align-items: center;

  padding: 9px 13px;

  border-radius: 13px;

  font-size: 13px;
  font-weight: 700;
}

.mandatory-badge {
  border: 1px solid rgba(201,149,46,.4);

  background: var(--gold-soft);

  color: #6c4b0e;
}

.dashboard-link {
  border: 1px solid var(--line);

  background: #fff;

  color: var(--teal-dark);

  text-decoration: none;
}


/* =========================================
   Main
   ========================================= */

.ai-main {
  padding: 38px 0 65px;
}


/* =========================================
   Intro
   ========================================= */

.ai-intro {
  display: grid;

  grid-template-columns:
    minmax(0,1fr)
    240px;

  gap: 20px;

  align-items: stretch;
}

.ai-intro-copy,
.ai-day-card {
  border: 1px solid var(--line);
  border-radius: 26px;

  background: rgba(255,255,255,.90);

  box-shadow:
    0 17px 45px rgba(23,43,51,.07);
}

.ai-intro-copy {
  padding: 30px;
}

.ai-eyebrow {
  display: inline-flex;

  padding: 7px 12px;

  border-radius: 999px;

  background: var(--mint);

  color: var(--teal-dark);

  font-size: 13px;
  font-weight: 700;
}

.ai-intro h1 {
  margin: 12px 0 7px;

  font-size: clamp(30px,4vw,45px);
  line-height: 1.25;
}

.ai-intro-copy p {
  max-width: 800px;

  margin: 0;

  color: var(--text);

  font-size: 16px;
  line-height: 1.9;
}

.ai-day-card {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 24px;

  background:
    linear-gradient(
      145deg,
      #fff0bd,
      #fffaf0
    );
}

.ai-day-card > span {
  color: #795615;

  font-size: 12px;
  font-weight: 700;
}

.ai-day-card strong {
  margin-top: 8px;

  font-size: 22px;
}

.ai-day-card small {
  margin-top: 5px;

  color: #715d36;

  line-height: 1.6;
}


/* =========================================
   Progress
   ========================================= */

.journey-progress {
  margin-top: 18px;

  padding: 20px 23px;

  border: 1px solid var(--line);
  border-radius: 21px;

  background: #fff;
}

.progress-head {
  display: flex;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 11px;
}

.progress-head strong {
  display: block;

  font-size: 16px;
}

.progress-head small {
  display: block;

  margin-top: 3px;

  color: var(--text);
}

.progress-head b {
  color: var(--teal);

  font-size: 22px;
}

.progress-track {
  height: 14px;

  overflow: hidden;

  border-radius: 999px;

  background: #e3efeb;
}

.progress-track span {
  display: block;

  width: 0;
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      var(--gold),
      var(--teal)
    );

  transition: width .35s ease;
}


/* =========================================
   Rules
   ========================================= */

.journey-rule {
  display: flex;
  align-items: flex-start;

  gap: 14px;

  margin-top: 18px;
  padding: 17px 20px;

  border: 1px solid rgba(201,149,46,.34);
  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      #fff5d8,
      #fffdf6
    );
}

.journey-rule-icon {
  font-size: 26px;
}

.journey-rule strong {
  display: block;

  margin-bottom: 3px;
}

.journey-rule p {
  margin: 0;

  color: #675c45;

  font-size: 14px;
  line-height: 1.8;
}


/* =========================================
   Assistant shell
   ========================================= */

.assistant-shell {
  margin-top: 20px;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 28px;

  background: #fff;

  box-shadow:
    0 22px 60px rgba(23,43,51,.10);
}

.assistant-header {
  min-height: 80px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  padding: 14px 20px;

  border-bottom: 1px solid var(--line);

  background:
    linear-gradient(
      135deg,
      #edf8f4,
      #f5faff
    );
}

.assistant-identity {
  display: flex;
  align-items: center;

  gap: 12px;
}

.assistant-avatar {
  width: 50px;
  height: 50px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  background:
    linear-gradient(
      145deg,
      var(--teal-dark),
      var(--teal)
    );

  font-size: 26px;
}

.assistant-identity strong {
  display: block;

  font-size: 17px;
}

.assistant-identity small {
  display: block;

  margin-top: 2px;

  color: var(--text);

  font-size: 12px;
}

.assistant-online {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  color: var(--teal-dark);

  font-size: 12px;
  font-weight: 700;
}

.assistant-online i {
  width: 9px;
  height: 9px;

  border-radius: 50%;

  background: #23a866;

  box-shadow:
    0 0 0 5px rgba(35,168,102,.11);
}


/* =========================================
   Messages
   ========================================= */

.assistant-messages {
  min-height: 220px;
  max-height: 520px;

  overflow-y: auto;

  display: flex;
  flex-direction: column;

  gap: 12px;

  padding: 24px;

  background:
    linear-gradient(
      180deg,
      #fbfdfd,
      #fffdf8
    );
}

.ai-message {
  max-width: min(78%, 720px);

  padding: 13px 16px;

  border-radius: 18px;

  line-height: 1.8;

  font-size: 15px;
}

.ai-message--assistant {
  align-self: flex-start;

  border-bottom-left-radius: 5px;

  background: var(--mint);

  color: #23484b;
}

.ai-message--user {
  align-self: flex-end;

  border-bottom-right-radius: 5px;

  background:
    linear-gradient(
      135deg,
      var(--teal-dark),
      var(--teal)
    );

  color: #fff;
}

.ai-message strong {
  font-weight: 700;
}


/* =========================================
   Start / question / locked
   ========================================= */

.journey-start,
.question-area,
.journey-locked,
.journey-completed {
  padding: 28px;

  border-top: 1px solid var(--line);

  background: #fff;

  text-align: center;
}

.start-icon,
.journey-locked > span,
.journey-completed > span {
  display: block;

  margin-bottom: 10px;

  font-size: 42px;
}

.journey-start h2,
.journey-locked h2,
.journey-completed h2 {
  margin: 0 0 8px;

  font-size: 24px;
}

.journey-start p,
.journey-locked p,
.journey-completed p {
  max-width: 700px;

  margin: 0 auto 12px;

  color: var(--text);

  line-height: 1.8;
}

.start-important {
  padding: 11px 14px;

  border-radius: 14px;

  background: var(--gold-soft);

  color: #6b4b11 !important;

  font-weight: 700;
}

.primary-button,
.secondary-button {
  min-height: 52px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 8px;

  padding: 12px 22px;

  border: 0;
  border-radius: 15px;

  text-decoration: none;

  font-weight: 700;
}

.primary-button {
  background:
    linear-gradient(
      135deg,
      var(--teal-dark),
      var(--teal)
    );

  color: #fff;

  box-shadow:
    0 12px 28px rgba(17,100,102,.22);
}

.secondary-button {
  border: 1px solid var(--line);

  background: #fff;

  color: var(--teal-dark);
}


/* =========================================
   Answer zone
   ========================================= */

.question-area {
  text-align: right;
}

.answer-zone {
  width: min(100%, 820px);

  margin-inline: auto;
}

.answer-label {
  display: block;

  margin-bottom: 8px;

  color: var(--ink);

  font-weight: 700;
}

.answer-input,
.answer-textarea {
  width: 100%;

  border: 1.5px solid rgba(17,100,102,.22);
  border-radius: 15px;

  background: #fff;

  color: var(--ink);

  outline: 0;

  transition:
    border-color .18s ease,
    box-shadow .18s ease;
}

.answer-input {
  min-height: 52px;

  padding: 11px 14px;
}

.answer-textarea {
  min-height: 120px;

  padding: 13px 14px;

  resize: vertical;
}

.answer-input:focus,
.answer-textarea:focus {
  border-color: var(--teal);

  box-shadow:
    0 0 0 4px rgba(17,100,102,.10);
}

.answer-choices {
  display: grid;

  grid-template-columns:
    repeat(2,minmax(0,1fr));

  gap: 10px;
}

.answer-choice {
  position: relative;
}

.answer-choice input {
  position: absolute;

  opacity: 0;

  pointer-events: none;
}

.answer-choice span {
  min-height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 11px 14px;

  border: 1.5px solid rgba(17,100,102,.16);
  border-radius: 14px;

  background: #f8fcfb;

  color: #31585b;

  text-align: center;

  font-weight: 700;

  cursor: pointer;

  transition: .18s ease;
}

.answer-choice:hover span {
  border-color: var(--gold);

  transform: translateY(-1px);
}

.answer-choice input:checked + span {
  border-color: var(--teal);

  background: var(--mint);

  color: var(--teal-dark);

  box-shadow:
    0 0 0 3px rgba(17,100,102,.09);
}

.answer-button {
  display: flex;

  margin:
    18px auto 0;
}


/* =========================================
   Locked
   ========================================= */

.journey-locked strong {
  display: block;

  margin: 15px auto;

  color: var(--teal-dark);

  font-size: 18px;
}


/* =========================================
   Footer note
   ========================================= */

.ai-foot-note {
  margin-top: 17px;

  padding: 14px 18px;

  border: 1px solid var(--line);
  border-radius: 16px;

  background: rgba(255,255,255,.72);

  color: var(--text);

  font-size: 12px;
  line-height: 1.75;

  text-align: center;
}


/* =========================================
   Fatal error
   ========================================= */

.fatal-error {
  position: fixed;
  inset: 0;

  z-index: 10000;

  display: grid;
  place-items: center;

  padding: 20px;

  background: #f8fbfa;
}

.fatal-error > div {
  width: min(100%, 420px);

  padding: 30px;

  border: 1px solid var(--line);
  border-radius: 25px;

  background: #fff;

  text-align: center;

  box-shadow:
    0 22px 60px rgba(23,43,51,.12);
}

.fatal-error span {
  font-size: 40px;
}

.fatal-error button {
  min-height: 48px;

  margin-top: 10px;
  padding: 10px 20px;

  border: 0;
  border-radius: 14px;

  background: var(--teal);

  color: #fff;

  font-weight: 700;
}


/* =========================================
   Mobile
   ========================================= */

@media (max-width: 760px) {

  .main-container {
    width: min(calc(100% - 20px), var(--container));
  }

  .header-inner {
    min-height: 72px;
  }

  .brand-text small,
  .mandatory-badge {
    display: none;
  }

  .dashboard-link {
    padding: 8px 10px;

    font-size: 11px;
  }

  .ai-main {
    padding-top: 20px;
  }

  .ai-intro {
    grid-template-columns: 1fr;
  }

  .ai-intro-copy {
    padding: 22px 18px;
  }

  .ai-day-card {
    padding: 18px;
  }

  .journey-progress,
  .journey-rule {
    padding: 16px;
  }

  .assistant-messages {
    min-height: 200px;

    padding: 16px;
  }

  .ai-message {
    max-width: 90%;

    font-size: 14px;
  }

  .journey-start,
  .question-area,
  .journey-locked,
  .journey-completed {
    padding: 20px 14px;
  }

  .answer-choices {
    grid-template-columns: 1fr;
  }

}

/* Continuous compatibility journey */

#unlockCountdown {
  display: none !important;
}

.ai-day-card {
  background:
    linear-gradient(
      145deg,
      #eaf8f1,
      #edf6ff
    ) !important;
}

.ai-day-card > span {
  color: #52666e !important;
}

.ai-day-card strong {
  color: #0b4d50 !important;
}

