:root {
  --bg: #f4f1f6;
  --panel: #ffffff;
  --ink: #2f2a33;
  --muted: #8a8290;
  --line: #e7e2ec;
  --brand: #8a3b4c;
  --brand-2: #c9a24b;
  --ok: #2e9e6b;
  --err: #d1495b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Jost', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ---------- Butonlar ---------- */
.btn {
  font-family: inherit;
  font-size: 0.9rem;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px -12px var(--brand);
}
.btn.primary:hover { background: #7a3241; }
.btn.secondary {
  background: var(--brand-2);
  color: #4a3a12;
}
.btn.secondary:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: #faf7fc; }

/* ---------- Giriş ekranı ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #fbe7ec, var(--bg));
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: 0 30px 70px -30px rgba(90, 40, 60, 0.4);
  text-align: center;
}
.login-emoji { font-size: 2.6rem; }
.login-card h1 {
  margin: 8px 0 2px;
  font-size: 1.5rem;
  color: var(--brand);
  font-weight: 600;
}
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 0.92rem; }
.login-card label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.login-card input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
}
.login-card input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(138, 59, 76, 0.12);
}
.login-card .btn { width: 100%; justify-content: center; margin-top: 4px; }
.login-err {
  color: var(--err);
  font-size: 0.85rem;
  margin: 12px 0 0;
}
.login-hint { color: var(--muted); font-size: 0.78rem; margin: 16px 0 0; }

/* ---------- Editör ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar-title { font-weight: 600; color: var(--brand); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-status { font-size: 0.85rem; color: var(--ok); min-width: 10px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.form-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.group h2 {
  margin: 0 0 14px;
  font-size: 1.02rem;
  color: var(--brand);
  font-weight: 600;
}
.group label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.group label:last-child { margin-bottom: 0; }
.group input[type="text"],
.group input[type="url"],
.group input[type="date"],
.group input[type="time"],
.group input[type="password"],
.group textarea,
.group select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}
.group input:focus,
.group textarea:focus,
.group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(138, 59, 76, 0.1);
}

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 140px; }

.switch {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.switch span { color: var(--ink); font-size: 0.9rem; }

/* Renkler */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.color {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
}
.color input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  background: #fff;
  cursor: pointer;
}
.palette-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.pal {
  font-family: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 30px;
  padding: 6px 14px;
  cursor: pointer;
}
.pal:hover { border-color: var(--brand); color: var(--brand); }

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  padding: 6px 0;
}
.actions .btn { flex: 1; justify-content: center; min-width: 140px; }

.account .muted { font-size: 0.8rem; color: var(--muted); margin: -6px 0 14px; }
.cred-status { font-size: 0.85rem; margin: 12px 0 0; }

/* Kişiye özel bağlantı bölümü */
.group.personal { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: #fffdfe; }
.group.personal .muted { font-size: 0.82rem; color: var(--muted); margin: -6px 0 16px; line-height: 1.5; }
#guestLink { background: #faf7fc; font-size: 0.85rem; color: var(--brand); cursor: text; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.share-actions .btn { flex: 1; justify-content: center; min-width: 120px; }

/* Önizleme */
.preview-col {
  position: sticky;
  top: 76px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.device-toggle button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.9rem;
}
.device-toggle button.active { border-color: var(--brand); background: #faf0f2; }
.preview-frame-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  background: #efeaf0;
  padding: 14px;
}
#preview {
  width: 100%;
  height: 78vh;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.5);
  transition: width 0.25s ease;
}
.preview-frame-wrap.mobile #preview { width: 390px; max-width: 100%; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .preview-col { position: static; max-height: none; order: -1; }
  #preview { height: 60vh; }
}
