/* Selamlaş — white/black glass, mobile-first, icon-only controls, no emoji. */

:root {
  --bg: #0b0b0d;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-muted: rgba(245, 245, 247, 0.6);
  --accent: #f5f5f7;
  --accent-text: #0b0b0d;
  --danger: #ff4d4f;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

button {
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ---- Landing ---- */

.landing {
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.landing-top {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  stroke: var(--text);
}

h1.brand-name {
  font-size: 28px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
  max-width: 280px;
}

.start-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-bottom: 8px;
}

.btn-start {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.btn-start:active {
  transform: scale(0.96);
}

.btn-start.searching {
  background: var(--glass-strong);
  color: var(--text);
  border: 1px solid var(--glass-border);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.12); }
  50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.04); }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 320px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.chip.selected {
  background: var(--text);
  color: var(--accent-text);
  border-color: transparent;
}

.chips-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.icon-btn.danger {
  color: var(--danger);
  border-color: rgba(255, 77, 79, 0.35);
}

footer.legal {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding-top: 10px;
}

footer.legal a,
footer.legal button {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ---- Overlays / sheets ---- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.overlay.active {
  display: flex;
}

.overlay.center {
  align-items: center;
}

.sheet {
  width: 100%;
  max-width: 420px;
  background: #16161a;
  border: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 85vh;
  overflow-y: auto;
}

.overlay.center .sheet {
  border-radius: 24px;
  margin: 0 20px;
}

.sheet h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.sheet p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.gate-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
}

.gate-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--text);
  flex-shrink: 0;
}

.gate-row label {
  font-size: 14px;
  line-height: 1.4;
}

.gate-row a {
  color: var(--text);
  text-decoration: underline;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

.reason-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reason-btn {
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.reason-note {
  width: 100%;
  resize: none;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  min-height: 56px;
}

.reason-note::placeholder {
  color: var(--text-muted);
}

/* ---- Chat ---- */

.chat-screen {
  padding-left: 0;
  padding-right: 0;
  padding-top: var(--safe-top);
}

.safety-strip {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.chat-topbar {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--glass-border);
}

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

.bubble-row {
  display: flex;
}

.bubble-row.me {
  justify-content: flex-end;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.35;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.bubble-row.me .bubble {
  background: var(--text);
  color: var(--accent-text);
  border-color: transparent;
}

.bubble.system {
  align-self: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  max-width: 90%;
}

.typing-row {
  padding: 0 16px;
  min-height: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.chat-inputbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--glass-border);
}

.chat-inputbar input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
}

.chat-inputbar input::placeholder {
  color: var(--text-muted);
}

.btn-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--text);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-send svg {
  width: 18px;
  height: 18px;
}

/* ---- Post-chat ---- */

.postchat {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.postchat p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

.postchat .btn-primary {
  max-width: 260px;
}

/* ---- Legal pages ---- */

.legal-page {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(32px + var(--safe-top)) 20px 60px;
  line-height: 1.6;
}

.legal-page h1 {
  font-size: 22px;
}

.legal-page h2 {
  font-size: 16px;
  margin-top: 28px;
}

.legal-page p,
.legal-page li {
  color: var(--text-muted);
  font-size: 14px;
}

.legal-page a {
  color: var(--text);
}

.legal-back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.hidden {
  display: none !important;
}
