/* Giriş kapısı (index.html, gate.js): Flutter yüklenirken ve oturum yokken görünen giriş sayfası. */

:root {
  --navy: #12284a;
  --navy-deep: #0d1f3b;
  --lime: #c5f05a;
  --ground: #f3f4ef;
  --ink: #12284a;
  --muted: #566274;
  --line: #d4d9cd;
  --field: #ffffff;
  --error: #b3261e;
  --soft: rgba(18, 40, 74, 0.06);
  --btn-bg: #12284a;
  --btn-bg-hover: #0d1f3b;
  --btn-fg: #ffffff;
  --ring: rgba(197, 240, 90, 0.6);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1d35;
    --ink: #eef1e8;
    --muted: #a3adbd;
    --line: #2b3f60;
    --field: #142a4b;
    --error: #ffb4a9;
    --soft: rgba(238, 241, 232, 0.07);
    --btn-bg: #c5f05a;
    --btn-bg-hover: #d4f57f;
    --btn-fg: #12284a;
    --ring: rgba(197, 240, 90, 0.35);
    color-scheme: dark;
  }
}

html, body { margin: 0; background: var(--navy); }

#gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr);
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 Figtree, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html[data-gate="off"] #gate { display: none; }

/* Giriş paneli */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 4vw, 56px) clamp(24px, 5vw, 72px);
  overflow-y: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  color: var(--ink);
  text-decoration: none;
  font: 800 24px/1 "Bricolage Grotesque", Figtree, sans-serif;
  letter-spacing: -0.02em;
}
.brand svg { width: 34px; height: 34px; }

.panel-body {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  padding: 48px 0 32px;
}

h1 {
  margin: 0 0 12px;
  font: 800 clamp(38px, 3.6vw, 52px)/1 "Bricolage Grotesque", Figtree, sans-serif;
  letter-spacing: -0.03em;
}

.lead { margin: 0 0 32px; font-size: 17px; color: var(--muted); }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 15px; }

.input {
  display: flex;
  align-items: center;
  height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--ring); }
.input.invalid { border-color: var(--error); }

.input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: 500 17px Figtree, system-ui, sans-serif;
}
.input input::placeholder { color: var(--muted); opacity: 0.7; }

.prefix {
  padding: 0 12px 0 16px;
  border-right: 1.5px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  line-height: 24px;
}
.phone input { padding-left: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.reveal {
  height: 100%;
  padding: 0 16px;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: none;
  color: var(--ink);
  font: 600 14px Figtree, system-ui, sans-serif;
  cursor: pointer;
}

.form-error { margin: 0 0 14px; color: var(--error); font-weight: 500; font-size: 15px; }
.form-error:empty { display: none; }

.submit {
  position: relative;
  width: 100%;
  height: 56px;
  margin-top: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 700 17px Figtree, system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}
.submit:hover { background: var(--btn-bg-hover); }
.submit:active { transform: scale(0.985); }
.submit[aria-busy="true"] { cursor: progress; }

.submit-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40%;
  height: 4px;
  background: var(--lime);
  transform: translateX(-100%);
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
}

.link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 15px Figtree, system-ui, sans-serif;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: text-decoration-color 0.15s;
}
.link:hover { text-decoration-color: currentColor; }

.forgot-note { overflow: hidden; }
.forgot-note p { margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--soft); font-size: 15px; }

.stores { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.stores h2 { margin: 0 0 4px; font: 700 17px Figtree, system-ui, sans-serif; }
.stores p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.stores strong { color: var(--ink); font-weight: 600; }


.panel-foot { font-size: 13.5px; color: var(--muted); }
.panel-foot p { margin: 0 0 6px; }
.panel-foot a { color: inherit; text-underline-offset: 3px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.input input:focus-visible { outline: none; }

/* Açılış: kayıtlı oturumla gelindi ya da giriş yapıldı; Flutter'ın ilk karesine kadar tahta tam ekran. */

/* Giriş sayfasında tahta tamamen sürüklemeye ayrılır (sayfa formdan kayar). */
#gate .pitch { touch-action: none; }

.boot-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14vh;
  margin: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  pointer-events: none;
}

html[data-gate="boot"] #gate { grid-template-columns: 1fr; }
html[data-gate="boot"] .panel,
html[data-gate="boot"] .lineup { display: none; }

#gate.entering { pointer-events: none; }

/* Dar ekran: tahta üstte şerit, form altında; sayfa kayar. */

@media (max-width: 860px) {
  #gate {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    overflow-y: auto;
  }
  .board { height: clamp(200px, 32svh, 320px); }
  html[data-gate="boot"] .board { height: 100svh; }
  .panel { overflow: visible; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .panel-body { padding: 28px 0 24px; }
  .lead { margin-bottom: 24px; }
  .stores { margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .input, .submit, .link { transition: none; }
}
