/* Ürün Bilgileri — tek stil dosyası, harici font/CDN yok. */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #dde3ea;
  --text: #1b2430;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent-hover: #1a43b8;
  --accent-soft: #eaf0ff;
  --ok: #157347;
  --ok-soft: #e7f5ec;
  --warn: #9a6700;
  --warn-soft: #fff6e0;
  --err: #b42318;
  --err-soft: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* 16px taban: iOS/Android'de input'a odaklanınca sayfa zoom yapmasın. */
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------- başlık */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--muted);
}

.brand--active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ----------------------------------------------------- profil menüsü */

.profile { position: relative; }

.profile__btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.profile__btn:hover,
.profile__btn[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.profile__btn svg { width: 22px; height: 22px; display: block; }

.profile__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(16, 24, 40, .12);
  padding: 6px;
  margin: 0;
  list-style: none;
}

.profile__menu[hidden] { display: none; }

.profile__who {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.profile__name { font-weight: 600; display: block; }

.profile__mail {
  color: var(--muted);
  font-size: 13px;
  display: block;
  word-break: break-all;
}

.profile__menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.profile__menu a:hover { background: var(--bg); }

.profile__menu a.is-danger { color: var(--err); }

/* --------------------------------------------------------- yerleşim */

.page {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Ürün Bilgileri ekranı: sonuç varken üstte, giriş kutusu altta.
   Sonuç yokken (ilk giriş) kutu ekranın tam ortasında durur. */
.scan-page {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
}

/* Giriş kutusu üstte, sonuç kartı onun altında. */
.scan-page__form { padding-top: 4px; }

.scan-page__result { margin-top: 24px; }

/* İlk giriş: başlık/açıklama yok, yalnızca dikey ve yatay ortalanmış kutu. */
.scan-page--empty { justify-content: center; }

.scan-page--empty .scan-page__form {
  padding-top: 0;
  /* Optik denge: matematiksel ortanın bir tık yukarısı daha dengeli görünür. */
  margin-bottom: 8vh;
}

/* ------------------------------------------------------------- form */

.scanform {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
}

.scanform__input {
  /* size=60 ile yaklaşık 60 karakterlik genişlik; dar ekranda küçülür. */
  font: 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 0 14px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-width: 0;
  flex: 0 1 auto;
}

.scanform__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  height: 52px;
  padding: 0 26px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover { background: var(--bg); border-color: var(--muted); }

.btn--block { width: 100%; }

.btn--sm { height: 44px; padding: 0 18px; font-size: 15px; }

/* ------------------------------------------------------------ kart */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card__title { font-size: 17px; font-weight: 600; margin: 0; }

.card__hint { color: var(--muted); font-size: 14px; margin: -8px 0 16px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--ok { background: var(--ok-soft); color: var(--ok); }

.badge--warn { background: var(--warn-soft); color: var(--warn); }

/* --------------------------------------------------- sonuç alanları */

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 0;
}

.field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.field dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.field dd {
  margin: 0;
  font: 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.field dd.is-empty { color: var(--muted); font-style: italic; font-family: inherit; }

.human {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 15px;
}

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}

table.data td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

table.data tr:last-child td { border-bottom: 0; }

details.raw {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

details.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  min-height: 28px;
}

details.raw pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 10px 0 0;
}

details.raw .raw-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ------------------------------------------------------- bildirimler */

.flash {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-size: 15px;
}

.flash--success { background: var(--ok-soft); border-color: #bfe0cb; color: var(--ok); }

.flash--error { background: var(--err-soft); border-color: #f4c7c3; color: var(--err); }

.flash--info { background: var(--accent-soft); border-color: #c7d6fb; color: var(--accent); }

/* ------------------------------------------------------ giriş ekranı */

.auth {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.auth__title { margin: 0 0 4px; font-size: 22px; text-align: center; }

.auth__sub { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 15px; }

/* --------------------------------------------------------- form alanı */

.form-row { margin-bottom: 16px; }

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[readonly] { background: var(--bg); color: var(--muted); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}

.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.form-help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-actions { margin-top: 20px; }

/* --------------------------------------------------------- alt bilgi */

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 16px;
}

/* ------------------------------------------------- tablet ve küçük ekran */

@media (max-width: 820px) {
  .page, .scan-page { padding-left: 14px; padding-right: 14px; }

  .scanform { flex-wrap: wrap; }

  .scanform__input { flex: 1 1 100%; width: 100%; }

  .btn--send { width: 100%; }

  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .brand { font-size: 16px; padding: 0 10px; }
}
