/* === Reset & base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: #f4f6f9;
  color: #1a1a2e;
  line-height: 1.6;
  direction: rtl;
}

/* === Demo banner === */
.demo-banner {
  background: #1a1a2e;
  color: #ffffff;
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.demo-badge {
  display: inline-block;
  background: #4cc9f0;
  color: #1a1a2e;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  font-size: 0.8rem;
}

.demo-text {
  opacity: 0.9;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 2rem 1rem 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 1rem;
  color: #3d4a6b;
  max-width: 560px;
  margin: 0 auto;
}

/* === Chat section === */
.chat-section {
  max-width: 680px;
  margin: 1.5rem auto 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e8ecf1;
  background: #fafbfd;
}

.chat-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
}

.btn-reset {
  background: none;
  border: 1px solid #c8d0dc;
  color: #5a6a8a;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-reset:hover,
.btn-reset:focus-visible {
  background: #eef1f6;
  color: #1a1a2e;
}

/* === Example questions === */
.example-questions {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e8ecf1;
}

.example-label {
  font-size: 0.85rem;
  color: #5a6a8a;
  margin-bottom: 0.5rem;
}

.example-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-example {
  background: #f0f4fa;
  border: 1px solid #dce3ef;
  color: #1a1a2e;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: right;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1.4;
}

.btn-example:hover,
.btn-example:focus-visible {
  background: #e3ebf7;
  border-color: #4cc9f0;
}

/* === Messages === */
.chat-messages {
  padding: 1rem 1.25rem;
  min-height: 180px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  display: flex;
}

.user-message {
  justify-content: flex-start;
}

.assistant-message {
  justify-content: flex-end;
}

.bubble {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.user-message .bubble {
  background: #4cc9f0;
  color: #1a1a2e;
  border-bottom-right-radius: 4px;
}

.assistant-message .bubble {
  background: #eef1f6;
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
}

/* === Typing indicator === */
.typing-indicator {
  padding: 0.5rem 1.25rem 0.5rem 1.25rem;
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.typing-indicator span {
  width: 10px;
  height: 10px;
  background: #b0b8c8;
  border-radius: 50%;
}

/* === Error message === */
.error-message {
  padding: 0.75rem 1.25rem;
  background: #fff4f4;
  color: #b91c1c;
  font-size: 0.875rem;
  text-align: center;
  border-top: 1px solid #fde2e2;
}

/* === Input area === */
.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e8ecf1;
  background: #fafbfd;
}

.chat-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  direction: rtl;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #4cc9f0;
}

.btn-send {
  background: #1a1a2e;
  color: #ffffff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-send:hover,
.btn-send:focus-visible {
  background: #2d3a5c;
}

/* === Offer section === */
.offer-section {
  max-width: 680px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d3a5c 100%);
  color: #ffffff;
  border-radius: 12px;
  text-align: center;
}

.offer-section h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.offer-desc {
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.btn-cta {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}

.btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-whatsapp {
  background: #0b5e2d;
  color: #ffffff;
}

.btn-email {
  background: #ffffff;
  color: #1a1a2e;
}

.btn-site {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.btn-site:hover {
  border-color: #ffffff;
}

/* === English section === */
.english-section {
  max-width: 680px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  direction: ltr;
  text-align: left;
}

.english-section h2 {
  font-size: 1.2rem;
  color: #1a1a2e;
  margin-bottom: 0.75rem;
}

.english-section p {
  font-size: 0.9rem;
  color: #3d4a6b;
  margin-bottom: 0.75rem;
}

.english-section .cta-buttons {
  flex-direction: row;
  justify-content: center;
  margin-top: 1rem;
}

.english-section .btn-cta {
  color: #ffffff;
}

.english-section .btn-email {
  background: #1a1a2e;
  color: #ffffff;
}

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: #3d4a6b;
}

.site-footer a {
  color: #1a6e8e;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* === Focus visible for accessibility === */
*:focus-visible {
  outline: 2px solid #4cc9f0;
  outline-offset: 2px;
}

/* === Responsive: 360px mobile (smallest phones) === */
@media (max-width: 360px) {
  .hero {
    padding: 1.5rem 0.75rem 0.75rem;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .hero-desc {
    font-size: 0.85rem;
  }

  .chat-section {
    margin: 0.75rem 0.25rem 1rem;
    border-radius: 6px;
  }

  .chat-header {
    padding: 0.6rem 0.75rem;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
  }

  .chat-messages {
    min-height: 120px;
    padding: 0.6rem 0.75rem;
  }

  .bubble {
    max-width: 92%;
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
  }

  .offer-section {
    margin: 1rem 0.25rem;
    padding: 1rem 0.75rem;
  }

  .english-section {
    margin: 1rem 0.25rem;
    padding: 0.85rem;
  }

  .site-footer {
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* === Responsive: up to 480px (standard mobile) === */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.4rem;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .chat-section {
    margin: 1rem 0.5rem 1.5rem;
    border-radius: 8px;
  }

  .chat-header {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .chat-messages {
    min-height: 140px;
    padding: 0.75rem 1rem;
  }

  .bubble {
    max-width: 88%;
    font-size: 0.9rem;
  }

  .offer-section {
    margin: 1.5rem 0.5rem;
    padding: 1.5rem 1rem;
  }

  .english-section {
    margin: 1.5rem 0.5rem;
    padding: 1rem;
  }
}

/* === Responsive: 1280px+ desktop (large screens) === */
@media (min-width: 1280px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-desc {
    font-size: 1.15rem;
  }

  .chat-section {
    max-width: 760px;
  }

  .offer-section {
    max-width: 760px;
  }

  .english-section {
    max-width: 760px;
  }

  .example-buttons {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .btn-example {
    flex: 1;
    min-width: 220px;
  }

  .cta-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .offer-section h2 {
    font-size: 1.8rem;
  }
}

/* === Responsive: 1024px+ tablet/laptop === */
@media (min-width: 1024px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-desc {
    font-size: 1.1rem;
  }

  .example-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .btn-example {
    flex: 1;
    min-width: 200px;
  }

  .cta-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .offer-section h2 {
    font-size: 1.6rem;
  }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .typing-indicator span {
    animation: none;
    opacity: 0.8;
    width: 10px;
    height: 10px;
  }

  .btn-cta:hover {
    transform: none;
  }
}
