/* SmartBox tasarım sistemi — panel, yönetici, giriş ve tanıtım sayfaları */

:root {
  --bg: #F5F2EC;
  --bg-2: #EFEBE3;
  --surface: #FFFFFF;
  --surface-2: #FAF8F4;
  --ink: #151513;
  --ink-2: #55524B;
  --ink-3: #8C887F;
  --line: rgba(21, 21, 19, .085);
  --line-2: rgba(21, 21, 19, .15);
  --accent: #A07546;
  --accent-soft: rgba(160, 117, 70, .12);
  --on-ink: #FAF8F4;
  --success: #2E7A4E;
  --success-soft: rgba(46, 122, 78, .12);
  --warn: #B07419;
  --warn-soft: rgba(176, 116, 25, .13);
  --danger: #B23E2C;
  --danger-soft: rgba(178, 62, 44, .1);
  --info: #3A5A8C;
  --info-soft: rgba(58, 90, 140, .11);

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(21, 21, 19, .05);
  --shadow: 0 1px 2px rgba(21, 21, 19, .04), 0 6px 20px -6px rgba(21, 21, 19, .08);
  --shadow-lg: 0 2px 6px rgba(21, 21, 19, .05), 0 24px 60px -12px rgba(21, 21, 19, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  .app:not([data-theme="light"]) {
    --bg: #0F0F0E;
    --bg-2: #161614;
    --surface: #1A1A18;
    --surface-2: #20201D;
    --ink: #F2EFE9;
    --ink-2: #B5B0A6;
    --ink-3: #7F7B73;
    --line: rgba(255, 255, 255, .075);
    --line-2: rgba(255, 255, 255, .14);
    --accent: #C9A270;
    --accent-soft: rgba(201, 162, 112, .14);
    --on-ink: #151513;
    --success: #5DBB84;
    --success-soft: rgba(93, 187, 132, .14);
    --warn: #E0A84A;
    --warn-soft: rgba(224, 168, 74, .14);
    --danger: #E9715C;
    --danger-soft: rgba(233, 113, 92, .13);
    --info: #8FB0E6;
    --info-soft: rgba(143, 176, 230, .13);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Butonlar */
.btn {
  --h: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: -.005em; white-space: nowrap;
  border: 1px solid transparent; user-select: none;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .15s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn-ghost { border-color: var(--line-2); background: transparent; }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-3); }
.btn-quiet { background: var(--bg-2); }
.btn-quiet:hover { background: color-mix(in srgb, var(--bg-2) 80%, var(--ink) 6%); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { --h: 34px; padding: 0 13px; font-size: 13px; }
.btn-lg { --h: 52px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn .spinner { width: 16px; height: 16px; }

/* Form alanları */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 16px; }
.label { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.label .hint { font-weight: 400; color: var(--ink-3); }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 16px; line-height: 1.4; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
@media (min-width: 768px) { .input, .textarea, .select { font-size: 14.5px; } }
.textarea { resize: vertical; min-height: 88px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238C887F' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-wrap .input { padding-left: 32px; }

/* Anahtar (switch) */
.switch { position: relative; display: inline-flex; flex: none; width: 46px; height: 28px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .25s var(--ease); }
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform .3s var(--ease-out);
}
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch-sm { width: 38px; height: 23px; }
.switch-sm span::after { width: 17px; height: 17px; }
.switch-sm input:checked + span::after { transform: translateX(15px); }

/* Segment kontrol */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: 999px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg .count { font-size: 11.5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--line); display: inline-grid; place-items: center; }

/* Çipler */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); transition: all .2s; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* Kart, rozet */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }

.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--success); opacity: .35; animation: ping 2s var(--ease-out) infinite; }
.live-dot.is-off { background: var(--warn); }
.live-dot.is-off::after { animation: none; opacity: 0; }
@keyframes ping { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(2.2); opacity: 0; } }

/* Sayfa/çekmece (sheet) — mobilde alttan, masaüstünde ortada */
.sheet-root { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.sheet-root.is-open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 12, 10, .42); opacity: 0; transition: opacity .35s var(--ease); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.sheet-root.is-open .sheet-backdrop { opacity: 1; }
.sheet {
  position: relative; width: 100%; max-height: calc(100dvh - 24px - var(--safe-top));
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(100%); transition: transform .45s var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.sheet-root.is-open .sheet { transform: none; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 10px; flex: none; }
.sheet-head h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.01em; line-height: 1.1; }
.sheet-body { padding: 8px 22px 22px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 14px 22px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; flex: none; background: var(--surface); }
@media (min-width: 768px) {
  .sheet-root { align-items: center; padding: 24px; }
  .sheet { max-width: 540px; border-radius: var(--r-xl); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .35s var(--ease-out), opacity .25s; max-height: calc(100dvh - 48px); }
  .sheet-root.is-open .sheet { opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 22px; }
  .sheet-foot { padding-bottom: 16px; }
}

.close-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; transition: background .2s; }
.close-btn:hover { background: var(--line-2); color: var(--ink); }
.close-btn svg { width: 16px; height: 16px; }

/* Bildirim (toast) */
.toasts { position: fixed; left: 50%; top: calc(14px + var(--safe-top)); transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; width: min(420px, calc(100% - 28px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--ink) 94%, transparent); color: var(--on-ink);
  font-size: 14px; box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: toast-in .45s var(--ease-out);
}
.toast.is-leaving { animation: toast-out .3s var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast-success svg { color: #7BD3A0; }
.toast-error svg { color: #F09A88; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* Yükleniyor */
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-2) 0%, color-mix(in srgb, var(--bg-2) 50%, var(--surface)) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Boş durum */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .serif { font-size: 26px; color: var(--ink); margin-bottom: 6px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--bg-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-2); }
.empty-icon svg { width: 22px; height: 22px; }

/* Marka */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16.5px; letter-spacing: -.025em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
