/* ==================================================================
   modules/auth.css · Giriş kapısı, davet, Hesap sayfası, adım yükseltme
   Renkler yalnız token'lardan (Açık / Yarı koyu / Koyu).
================================================================== */

/* Oturum kapalıyken uygulama kabuğu görünmez (ilk boyamada da) */
.au-locked .app, .au-locked .tabbar { visibility: hidden; }

/* ---------- Tam ekran kapı ---------- */
dialog.au-gate {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border-radius: 0; box-shadow: none;
  background: var(--bg); color: var(--text); overflow-y: auto; overflow-x: hidden;
}
dialog.au-gate::backdrop { background: var(--bg); animation: none; }
.au-screen { min-height: 100%; display: grid; grid-template-rows: auto 1fr; padding: 20px 28px 32px; box-sizing: border-box; }
.au-top { display: flex; align-items: center; gap: 10px; }
.au-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.au-brand { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.au-card {
  align-self: center; justify-self: center; width: min(380px, 100%);
  display: grid; gap: 14px; padding: 28px 0 56px; min-width: 0;
  animation: au-in 240ms var(--ease-out);
}
@keyframes au-in { from { opacity: 0; transform: translateY(6px); } }
.au-h { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.au-h .hint-i { vertical-align: 0; }
.au-h .badge { font-size: 11.5px; letter-spacing: 0; }
.au-sub { margin: -6px 0 2px; color: var(--text-2); font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.au-card form { display: grid; gap: 14px; }
.au-wide { width: 100%; height: 40px; font-size: 14px; }
.au-wide svg.i { width: 18px; height: 18px; }
.au-alt { display: grid; gap: 8px; }
.au-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.au-demo { padding-top: 4px; border-top: 1px solid var(--line); }
.au-demo .btn { margin-top: 10px; }
.au-lblrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.au-lblrow label { font-size: 13px; font-weight: 600; }
.au-link { border: 0; background: transparent; padding: 2px 0; color: var(--accent); font-size: 13px; font-weight: 500; border-radius: 4px; }
.au-link:hover { text-decoration: underline; }
.au-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.au-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin: 0 0 -4px -6px; padding: 4px 8px 4px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; }
.au-back:hover { background: var(--hover); color: var(--text); }
.au-formerr { padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; line-height: 1.4; }
.au-formerr.green { background: var(--green-soft); color: var(--green); }
.au-formerr.muted { background: var(--surface-2); color: var(--text-2); }
.au-mono { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }

/* Şifre alanı: göster/gizle, güç, kurallar */
.au-pw { position: relative; }
.au-pw .input { padding-right: 40px; }
.au-pw .au-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.au-pw .au-eye:active { transform: translateY(-50%) scale(.94); }
.au-meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 52px; gap: 4px; align-items: center; }
.au-meter i { height: 4px; border-radius: 2px; background: var(--line); transition: background-color 160ms ease; }
.au-meter em { font-style: normal; font-size: 12px; color: var(--text-2); text-align: right; }
.au-meter[data-score="1"] i:nth-child(-n+1) { background: var(--red); }
.au-meter[data-score="2"] i:nth-child(-n+2) { background: var(--orange); }
.au-meter[data-score="3"] i:nth-child(-n+3) { background: var(--accent); }
.au-meter[data-score="4"] i:nth-child(-n+4) { background: var(--green); }
.au-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: var(--text-3); }
.au-rules li { display: flex; align-items: center; gap: 5px; transition: color 140ms ease; }
.au-rules li svg.i { width: 12px; height: 12px; opacity: .35; }
.au-rules li.ok { color: var(--green); }
.au-rules li.ok svg.i { opacity: 1; }

/* 6 haneli kod kutuları */
.au-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 340px; }
.au-card .au-otp { max-width: none; }
.au-otp-box {
  width: 100%; min-width: 0; height: 48px; padding: 0; text-align: center;
  font: 600 20px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.au-otp-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.au-otp-box:disabled { opacity: .5; }
.au-otp.invalid .au-otp-box, .invalid > .au-otp .au-otp-box { border-color: var(--red); }

/* Liste satırları (Google hesabı, passkey, bağlam) */
.au-list .au-row { min-height: 58px; }
.au-row > svg.i:last-child { color: var(--text-3); width: 16px; height: 16px; }
.au-row .tenant-mark { width: 34px; height: 34px; }
.au-ico { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.group .au-ico { background: var(--surface); }
.au-ico svg.i { width: 16px; height: 16px; }
.au-inviter { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-inviter .tenant-mark { width: 36px; height: 36px; }
.au-inviter strong { display: block; font-size: 14px; }
.au-inviter span span { color: var(--text-2); font-size: 12.5px; }
.au-kv { grid-template-columns: 110px minmax(0, 1fr); }
.au-kv dd { overflow-wrap: anywhere; }
.au-state { display: grid; justify-items: center; gap: 12px; text-align: center; }
.au-state > svg.i { width: 40px; height: 40px; color: var(--accent); stroke-width: 1.5; }
.au-state .au-h { justify-content: center; }
.au-state .au-sub { justify-content: center; margin: -4px 0 6px; }

/* MFA kurulumu */
.au-mfa-setup { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; }
.au-card .au-mfa-setup { grid-template-columns: 1fr; justify-items: start; }
.au-qr { width: 168px; aspect-ratio: 1; padding: 8px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); box-sizing: border-box; }
.au-card .au-qr { width: 150px; justify-self: center; }
.au-qr-svg { width: 100%; height: 100%; display: block; fill: var(--text); }
.au-qr-svg .q0 { fill: var(--surface); }
.au-mfa-side { display: grid; gap: 14px; min-width: 0; width: 100%; }
.au-secret { display: flex; align-items: center; gap: 4px; }
.au-secret-v { flex: 1; min-width: 0; font: 600 13px/1 var(--mono); letter-spacing: .08em; padding: 10px; border-radius: 8px; background: var(--surface-2); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.au-codes code { font: 600 13.5px/1.2 var(--mono); letter-spacing: .06em; text-align: center; padding: 6px 4px; color: var(--text); }
.au-codes code.used { color: var(--text-3); text-decoration: line-through; font-weight: 400; }
.au-codes-tools { display: flex; gap: 8px; flex-wrap: wrap; }

/* Adım yükseltme diyaloğu */
.au-reason { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.au-reason svg.i { color: var(--accent); width: 16px; height: 16px; }
.au-stepup .au-otp { max-width: none; }

/* ---------- Hesap sayfası ---------- */
.au-page { gap: 16px; }
.au-grid3 { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.au-grid2 { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.au-grid-n { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 16px; align-items: stretch; }
.au-col { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 16px; min-width: 0; min-height: 0; }
.au-panel .panel-head .tools .badge { font-size: 11.5px; }
.au-panel > .panel-body { padding: 16px; }
.au-form { display: grid; gap: 16px; }
.au-form .au-rules { margin-top: 2px; }
.au-pending { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.au-pending > span { flex: 1; min-width: 140px; }
.au-note { margin: 0; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.au-avatar-edit { display: grid; justify-items: center; gap: 18px; padding: 8px 0 4px; }
.au-avatar-edit .field { justify-items: center; }
.avatar.au-avatar-xl { width: 76px; height: 76px; font-size: 26px; letter-spacing: 0; }
.au-tones { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.au-tone { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; position: relative; background: var(--tone-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent); transition: box-shadow 140ms ease, transform 120ms var(--ease-out); }
.au-tone::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--tone); }
.au-tone:active { transform: scale(.94); }
.au-tone[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tone); }
.au-tone:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 50%; }
.au-bh { margin: 20px 0 8px; }
.au-status { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.au-status + .au-status { border-top: 1px solid var(--line); padding-top: 12px; }
.au-status > svg.i { color: var(--text-2); }
.au-status .main-txt { flex: 1; min-width: 0; }
.au-status .main-txt strong { display: block; font-weight: 600; }
.au-status .main-txt span { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.au-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.au-actions .au-note { margin-left: 4px; }
.au-warn { margin: 4px 0 12px; }
.au-warn svg.i { color: var(--orange); }
.au-tipwrap { display: inline-flex; border-radius: 8px; }

/* Oturumlar */
.au-stack { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.au-sess { flex: none; max-height: 46%; }
.au-hist { flex: 1; }
.au-sess > .panel-body, .au-hist > .panel-body { padding: 0; }
.au-table th { background: var(--surface); padding: 10px; }
.au-table th:first-child, .au-table td:first-child { padding-left: 16px; }
.au-table th:last-child, .au-table td:last-child { padding-right: 16px; }
.au-table tr:last-child td { border-bottom: 0; }
.au-dev { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-dev strong { font-weight: 600; }
.au-dev small, .au-small { display: block; color: var(--text-2); font-size: 12px; }
.au-tdr { text-align: right; width: 1%; white-space: nowrap; }
.au-nowrap { white-space: nowrap; }

/* Bildirim matrisi */
.au-np > .panel-body { padding: 0; }
.au-matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.au-matrix th, .au-matrix td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.au-matrix tbody tr:last-child th, .au-matrix tbody tr:last-child td { border-bottom: 0; }
.au-matrix tbody th { text-align: left; font-weight: 500; padding-left: 16px; }
.au-matrix thead th { font-size: 12px; font-weight: 600; color: var(--text-2); }
.au-ch { text-align: center; width: 15%; }
.au-chh { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.au-chh .badge { height: 20px; font-size: 11px; }
.au-sw { justify-content: center; }
.au-sw input:disabled { opacity: .45; cursor: not-allowed; }
.au-row-sw { display: flex; justify-content: space-between; width: 100%; margin-bottom: 14px; }
.au-row-sw + .two { margin-bottom: 14px; }

/* ---------- Telefon ---------- */
@media (max-width: 760px) {
  .au-screen { padding: 14px 16px 24px; }
  .au-card { padding: 20px 0 32px; }
  .au-h { font-size: 22px; }
  .au-otp-box { height: 46px; }
  .au-rules { grid-template-columns: 1fr; }
  .au-mfa-setup { grid-template-columns: 1fr; justify-items: center; }
  .au-mfa-side { justify-items: stretch; }

  #toolbar .view-switch.au-switch { display: inline-flex !important; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
  #toolbar .au-switch::-webkit-scrollbar { display: none; }
  #toolbar .au-switch button { white-space: nowrap; flex: none; padding: 0 9px; }
  #toolbar .au-switch svg.i, #toolbar .au-switch .seg-n { display: none; }
  #toolbar:has(.au-switch) h1 { display: none; }

  .au-grid3, .au-grid2, .au-grid-n { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; align-items: start; flex: none; }
  .au-col { grid-template-rows: none; }
  .au-stack { flex: none; }
  .au-sess { max-height: none; }
  .au-hist { flex: none; }
  .au-matrix th, .au-matrix td { padding: 10px 4px; }
  .au-matrix tbody th { padding-left: 12px; font-size: 13px; }
  .au-chh { flex-direction: column; gap: 2px; font-size: 10.5px; line-height: 1.2; }
  .au-chh .badge { display: none; }
  .au-ch { width: 16%; }
  .au-table td, .au-table th { padding-left: 8px; padding-right: 8px; }
}
