:root {
  --green: #2a8768;
  --green-dark: #1f6f54;
  --brown: #5b3a24;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1b2420;
  --muted: #6b7a73;
  --border: #e2e8e4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ---------- ANA EKRAN (LANDING) ---------- */
.landing {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Arka plan görseli + üzerine soluk beyaz katman (yazılar okunsun diye) */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)),
    url("/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.landing-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
}
.landing-logo {
  height: 78px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.75);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.lang-toggle button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 13px; padding: 2px 4px;
}
.lang-toggle button.active { color: var(--green-dark); text-decoration: underline; }
.lang-toggle span { color: #bbb; }

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}
.hero-card {
  width: 100%;
  max-width: 640px;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  padding: 32px 28px 36px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.hero-pre {
  color: var(--brown);
  letter-spacing: .35em;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.hero-title {
  color: var(--brown);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.hero-title span { display: block; font-size: clamp(30px, 8vw, 58px); }
.hero-sub {
  color: var(--brown);
  font-size: clamp(15px, 3.5vw, 20px);
  margin-bottom: 22px;
  opacity: .9;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  border: 2px solid var(--brown);
  background: rgba(91,58,36,.85);
  color: #fff;
  text-decoration: none;
  transition: transform .05s;
}
.hero-btn:active { transform: translateY(1px); }
.hero-btn.primary {
  background: var(--green);
  border-color: var(--green-dark);
}

.landing-footer {
  text-align: center;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--brown);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}
.landing-footer a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}
.landing-footer a:hover { text-decoration: underline; }

/* Giriş ve sohbet ekranlarındaki ince "Powered by" satırı */
.mini-footer {
  text-align: center;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--muted);
  background: var(--card);
}
.mini-footer a { color: var(--green-dark); font-weight: 600; text-decoration: none; }
.mini-footer a:hover { text-decoration: underline; }
/* Giriş ekranı (koyu zemin): alta sabit, açık renkli */
.mini-footer.light {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.mini-footer.light a { color: #fff; text-decoration: underline; }

/* ---------- GİRİŞ ---------- */
.login-screen {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Ana ekranla aynı manzara arka planı + okunurluk için soluk katman */
  background-image:
    linear-gradient(rgba(31, 111, 84, 0.55), rgba(24, 90, 68, 0.55)),
    url("/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.login-card {
  position: relative;
  background: var(--card);
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  padding: 36px 24px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-back {
  position: absolute;
  top: 14px; left: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13px;
}
.login-logo-img { height: 60px; border-radius: 6px; margin-bottom: 8px; }
.login-card h1 { font-size: 20px; color: var(--green-dark); }
.login-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.login-card input {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 16px; margin-bottom: 12px;
}
.login-card input:focus { outline: none; border-color: var(--green); }
.login-error { color: #c0392b; font-size: 14px; margin-top: 10px; }
.login-hint { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------- SOHBET ---------- */
.chat-screen { display: flex; flex-direction: column; height: 100dvh; max-width: 720px; margin: 0 auto; background: var(--bg); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--green); color: #fff;
}
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-logo { height: 34px; border-radius: 5px; }
.topbar-title strong { display: block; font-size: 15px; }
.topbar-title small { font-size: 12px; opacity: .85; }
.btn-text { background: none; border: none; color: #fff; font-size: 14px; cursor: pointer; opacity: .9; }

.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.welcome { text-align: center; margin: auto 0; color: var(--muted); }
.welcome-emoji { font-size: 40px; }
.welcome h2 { color: var(--text); margin: 8px 0 4px; }
.welcome p { font-size: 14px; margin-bottom: 18px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--green-dark); cursor: pointer; }
.chip:active { background: #eef3f0; }

.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.ai p { margin: 0 0 8px; } .msg.ai p:last-child { margin-bottom: 0; }
.msg.ai ul, .msg.ai ol { margin: 4px 0 8px 20px; }
.msg.ai code { background: #eef3f0; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.msg.ai strong { font-weight: 600; }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.input-bar { display: flex; gap: 8px; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--border); }
.input-bar textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 22px; padding: 11px 16px; font-size: 16px; font-family: inherit; max-height: 120px; line-height: 1.4; }
.input-bar textarea:focus { outline: none; border-color: var(--green); }

.btn-primary { width: 100%; padding: 14px; background: var(--green); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-primary:active { background: var(--green-dark); }
.btn-primary:disabled { opacity: .6; }
.btn-send { width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 50%; background: var(--green); color: #fff; font-size: 18px; cursor: pointer; }
.btn-send:disabled { opacity: .5; }
