/* ============================
   Elisa Health — Design System
   ============================ */

:root {
  --green: #0ea571;
  --green-dark: #0b8a5e;
  --green-light: #e6f9f1;
  --black: #0f1117;
  --gray-900: #1a1d27;
  --gray-600: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 24px rgba(14,165,113,.12), 0 1px 4px rgba(0,0,0,.06);
  --transition: .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-icon { color: var(--green); font-size: 1.3rem; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav a { font-size: .9rem; font-weight: 500; color: var(--gray-600); transition: color var(--transition); }
.nav a:hover { color: var(--black); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--green);
  color: var(--white);
}

.btn:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-900); }
.btn-outline:hover { border-color: var(--green); color: var(--green); background: var(--green-light); transform: translateY(-1px); }
.btn-sm { padding: 6px 16px; font-size: .82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---- Hero ---- */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--green-light) 0%, var(--white) 100%);
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 40px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  font-size: .8rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--black);
}

.text-accent { color: var(--green); }

.hero-sub {
  max-width: 600px;
  margin: 0 auto 32px;
  color: var(--gray-600);
  font-size: 1.05rem;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 56px;
}

.stat strong { display: block; font-size: 1.6rem; color: var(--black); }
.stat span { font-size: .82rem; color: var(--gray-600); }

/* ---- Section ---- */
.section { padding: 96px 0; }
.section-alt { background: var(--gray-100); }
.section-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--green);
  margin-bottom: 8px;
  text-align: center;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 56px;
  color: var(--black);
}

/* ---- Cards ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--transition);
}

.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--green-light); }

.card-icon { font-size: 2rem; margin-bottom: 16px; }
.card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--gray-600); font-size: .9rem; margin-bottom: 16px; }
.card-link { font-weight: 600; font-size: .88rem; color: var(--green); }
.card-link:hover { text-decoration: underline; }

/* ---- Steps ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  text-align: center;
}

.step-number {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--gray-600); font-size: .9rem; }

/* ---- Pricing ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  align-items: start;
}

.price-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  position: relative;
  transition: all var(--transition);
}

.price-card:hover { box-shadow: var(--shadow-lg); }

.price-card-featured {
  border: 2px solid var(--green);
  box-shadow: var(--shadow-lg);
}

.price-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
}

.price-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

.price {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 24px;
}

.price span { font-size: .9rem; font-weight: 500; color: var(--gray-600); }

.price-card ul { margin-bottom: 28px; }
.price-card li {
  padding: 8px 0;
  font-size: .88rem;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}
.price-card li:last-child { border: none; }

/* ---- Footer ---- */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 64px 0 32px;
}

.footer-inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-brand .logo { color: var(--white); margin-bottom: 12px; }
.footer-brand p { font-size: .88rem; color: var(--gray-600); }

.footer-links { display: flex; gap: 64px; }
.footer-links h4 { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--white); margin-bottom: 16px; }
.footer-links a { display: block; font-size: .88rem; color: var(--gray-600); margin-bottom: 8px; transition: color var(--transition); }
.footer-links a:hover { color: var(--green); }

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: .78rem;
  color: var(--gray-600);
}

.footer-legal { max-width: 700px; line-height: 1.7; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 24px; gap: 16px; border-bottom: 1px solid var(--gray-100); }
  .nav-open { display: flex; }
  .mobile-menu-btn { display: block; }
  .hero-stats { gap: 24px; }
  .footer-inner { flex-direction: column; }
  .footer-links { gap: 32px; }
}

/* ============================
   App Page Styles
   ============================ */

.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--gray-100);
  border-right: 1px solid var(--gray-300);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-600);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--gray-600);
}

.sidebar-item:hover { background: var(--white); color: var(--black); }
.sidebar-item.active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.sidebar-item .item-icon { font-size: 1.2rem; }

/* Chat area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.chat-header h2 { font-size: 1.1rem; font-weight: 700; }
.chat-header p { font-size: .82rem; color: var(--gray-600); }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  line-height: 1.6;
}

.message-user {
  align-self: flex-end;
  background: var(--green);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message-ai {
  align-self: flex-start;
  background: var(--gray-100);
  color: var(--gray-900);
  border-bottom-left-radius: 4px;
}

.message-ai p { margin-bottom: 8px; }
.message-ai p:last-child { margin-bottom: 0; }
.message-ai strong { color: var(--black); }
.message-ai ul, .message-ai ol { padding-left: 18px; margin: 8px 0; }
.message-ai li { margin-bottom: 4px; }

.typing-indicator {
  align-self: flex-start;
  padding: 14px 18px;
  background: var(--gray-100);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--gray-600);
  display: none;
}

.typing-indicator.visible { display: block; }

/* Input bar */
.input-bar {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 10px;
  align-items: end;
}

.input-bar textarea {
  flex: 1;
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: .9rem;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  outline: none;
  transition: border-color var(--transition);
}

.input-bar textarea:focus { border-color: var(--green); }

.input-bar .btn-send {
  height: 48px;
  width: 48px;
  padding: 0;
  border-radius: 10px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Photo upload */
.photo-upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 12px;
}

.photo-upload-zone:hover { border-color: var(--green); background: var(--green-light); }
.photo-upload-zone p { font-size: .88rem; color: var(--gray-600); }
.photo-upload-zone .upload-icon { font-size: 2rem; margin-bottom: 8px; }

.photo-preview {
  max-width: 200px;
  border-radius: var(--radius);
  margin: 12px auto;
  display: none;
}

/* API key notice */
.api-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 24px;
  font-size: .85rem;
  color: #92400e;
}

.api-notice input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-family: inherit;
  font-size: .85rem;
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    gap: 6px;
  }
  .sidebar-title { display: none; }
  .sidebar-item { white-space: nowrap; padding: 8px 14px; font-size: .82rem; }
  .messages { padding: 16px; }
  .input-bar { padding: 12px 16px; }
}
