/* ==========================================================================
   GİRİŞ EKRANI  (templates/home/index.html)
   ==========================================================================
   Bilerek Bootstrap YÜKLEMEZ: giriş ekranı tek bir ekran, uygulamanın geri
   kalanıyla hiçbir bileşen paylaşmıyor. Böylece ilk boyama iki dosyaya iniyor
   (bu dosya + landing.js) ve sayfa CDN'e erişilemese de tam görünür.

   Tema: baselayout ile AYNI anahtarı okur (localStorage 'dmvc-theme'), o yüzden
   burada seçilen tema panoda da geçerli olur. Anahtar yoksa işletim sisteminin
   tercihi kullanılır.

   Renk mantığı:
     - 'logix backend' yazısı GRİ; 'logix'in "o" harfi bir ton AÇIK gri
     - vurgu (düğme, etiketler, grafik aksanları) kehribar/turuncu
     - gövde metni beyaza yakın
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Renk belirteçleri (koyu = varsayılan) ------------------------------- */
:root {
  --bg: #0a0d13;
  --bg-glow: rgba(251, 191, 36, 0.10);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.055);

  --ink: #e9edf3;
  --ink-dim: #99a2ae;
  --ink-faint: #656d7a;

  --accent: #fbbf24;
  --accent-strong: #f59e0b;
  --accent-soft: rgba(251, 191, 36, 0.13);
  --accent-line: rgba(251, 191, 36, 0.32);

  /* Logo: gövde grisi ve bir ton açık olan "o" */
  --logo: #8e97a4;
  --logo-o: #dde3ea;
  --logo-sub: #656d7a;

  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Açık tema: hem işletim sistemi tercihi hem de panodaki tema düğmesiyle
   kaydedilen değer (data-theme="light") aynı paleti açar. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7f9;
    --bg-glow: rgba(245, 158, 11, 0.14);
    --surface: rgba(15, 23, 42, 0.03);
    --surface-2: rgba(15, 23, 42, 0.055);
    --line: rgba(15, 23, 42, 0.12);
    --line-soft: rgba(15, 23, 42, 0.07);

    --ink: #1b2028;
    --ink-dim: #5b636f;
    --ink-faint: #868e9a;

    --accent: #d97706;
    --accent-strong: #b45309;
    --accent-soft: rgba(217, 119, 6, 0.12);
    --accent-line: rgba(217, 119, 6, 0.30);

    --logo: #6d7683;
    --logo-o: #aab2bd;
    --logo-sub: #8d95a1;
  }
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-glow: rgba(245, 158, 11, 0.14);
  --surface: rgba(15, 23, 42, 0.03);
  --surface-2: rgba(15, 23, 42, 0.055);
  --line: rgba(15, 23, 42, 0.12);
  --line-soft: rgba(15, 23, 42, 0.07);

  --ink: #1b2028;
  --ink-dim: #5b636f;
  --ink-faint: #868e9a;

  --accent: #d97706;
  --accent-strong: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --accent-line: rgba(217, 119, 6, 0.30);

  --logo: #6d7683;
  --logo-o: #aab2bd;
  --logo-sub: #8d95a1;
}

/* --- İskelet ------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: grid;
  place-items: center;
  padding: 2.5rem 1rem;
  position: relative;
  overflow-x: hidden;
}

/* Arka plandaki ışıma + noktalı ızgara. Yalnızca dekoratif, tıklamayı
   engellemesin diye ayrı bir katmanda. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 50% -8%, var(--bg-glow), transparent 70%),
    radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: auto, 26px 26px;
  mask-image: radial-gradient(760px 520px at 50% 20%, #000 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(760px 520px at 50% 20%, #000 40%, transparent 85%);
}

.stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  text-align: center;
}

/* --- Logo kilidi: işaret + yazı ------------------------------------------ */
.lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.mark { width: 76px; height: 76px; flex: 0 0 auto; display: block; }

/* transform-box olmadan SVG grubunun dönme merkezi viewBox'ın değil
   kutusunun sol üstü olur ve halka ekrandan kayar. */
.mark .mk-ring {
  animation: mk-spin 48s linear infinite;
  transform-box: view-box;
  transform-origin: 36px 36px;
}
@keyframes mk-spin { to { transform: rotate(360deg); } }

.wordmark {
  text-align: left;
  line-height: 1;
}
.wm-name {
  display: block;
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--logo);
}
/* İstenen ayrıntı: 'logix'in "o" harfi bir ton açık gri. */
.wm-o { color: var(--logo-o); }
.wm-sub {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--logo-sub);
}

.tagline {
  margin: 0 auto 2rem;
  max-width: 34rem;
  color: var(--ink-dim);
  font-size: 0.98rem;
  font-weight: 300;
}
.tagline strong { color: var(--ink); font-weight: 500; }

/* --- Tema grafiği: backend -> uç noktalar, üstte zamanlayıcı ------------- */
.scene {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto 2.1rem;
}
.scene .sc-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  fill: var(--accent);
  text-transform: uppercase;
}
.scene .sc-plate { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.scene .sc-bar { fill: var(--ink-faint); opacity: 0.55; }
.scene .sc-dot { fill: var(--accent); }
.scene .sc-hollow { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.scene .sc-wire {
  fill: none;
  stroke: var(--accent-line);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
  animation: sc-flow 2.4s linear infinite;
}
.scene .sc-wire-2 { animation-delay: -0.8s; }
.scene .sc-wire-3 { animation-delay: -1.6s; }
.scene .sc-dial { fill: none; stroke: var(--line); stroke-width: 1.2; }
.scene .sc-tick { stroke: var(--ink-faint); stroke-width: 1.4; stroke-linecap: round; opacity: 0.7; }
.scene .sc-hand { stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.scene .sc-arc { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }

@keyframes sc-flow { to { stroke-dashoffset: -18; } }

/* --- Giriş düğmesi ve formu ---------------------------------------------- */
.actions { display: flex; justify-content: center; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.72rem 2.1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #1a1a1a;
  box-shadow: 0 8px 26px -14px var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-dim);
  padding: 0.55rem 1.2rem;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--accent-line); }
.btn:focus-visible,
.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Form açılana kadar DOM'da ama gizli: JS yüklenmezse [hidden] kalır ve
   kullanıcı yanlış bir şey görmez. */
.login[hidden] { display: none; }
.login {
  margin: 0 auto;
  max-width: 21rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.35rem;
  animation: pop 0.22s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

.login h2 {
  margin: 0 0 1rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.field { margin-bottom: 0.85rem; }
.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.field input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
}
.field input:focus { border-color: var(--accent-line); }

.login .row { display: flex; gap: 0.6rem; align-items: center; margin-top: 1.1rem; }
.login .row .btn-primary { flex: 1; padding: 0.6rem 1rem; }

.alert {
  margin-top: 0.9rem;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.10);
  color: #fca5a5;
  font-size: 0.85rem;
}
:root[data-theme="light"] .alert { color: #b91c1c; }
.alert[hidden] { display: none; }

/* --- Sunucu saati -------------------------------------------------------- */
.clock {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
/* Saat parçası sunucudan geliyor (GetClockFragment): iki satır iç içe
   span, yığılmaları buradan geliyor. */
#clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.clock-time {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 5vw, 1.95rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.clock-date {
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}
.clock-note {
  margin-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
}

/* --- Alt künye ----------------------------------------------------------- */
.meta {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
}
.meta span {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--ink-faint);
}
.meta span.hl { color: var(--accent); border-color: var(--accent-line); }

@media (max-width: 460px) {
  .lockup { gap: 0.8rem; }
  .mark { width: 58px; height: 58px; }
  .wm-sub { letter-spacing: 0.24em; }
}

@media (prefers-reduced-motion: reduce) {
  .mark .mk-ring, .scene .sc-wire { animation: none; }
  .login { animation: none; }
}
