/* ETB — giriş ekranı (yalnızca açık / beyaz tema) */

html:not(.etb-authed) .layout-container,
html:not(.etb-authed) .sidebar-overlay {
  visibility: hidden;
}

#authGate {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    'SF Pro Rounded',
    'SF Pro Text',
    'SF Pro Display',
    system-ui,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern' 1;
  color-scheme: light;
  overflow: hidden;
  /* Beyaz kutudan ayrışan hafif gri zemin */
  background-color: #e8e8ec;
  background-image:
    radial-gradient(ellipse 70% 55% at 88% 12%, rgba(254, 203, 22, 0.22), transparent 72%),
    radial-gradient(ellipse 65% 50% at 8% 88%, rgba(254, 203, 22, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 45% at 48% 48%, rgba(254, 203, 22, 0.08), transparent 68%);
}

/* Bulanık ETB sarısı blob’lar (ana renk) */
#authGate::before,
#authGate::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(76px);
  will-change: transform;
}

#authGate::before {
  width: min(92vw, 440px);
  height: min(92vw, 440px);
  background: rgba(254, 203, 22, 0.5);
  top: -18%;
  right: -12%;
  animation: authGateBlobA 16s ease-in-out infinite alternate;
}

#authGate::after {
  width: min(85vw, 400px);
  height: min(85vw, 400px);
  background: rgba(254, 203, 22, 0.35);
  bottom: -22%;
  left: -14%;
  animation: authGateBlobB 20s ease-in-out infinite alternate;
}

@keyframes authGateBlobA {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-6%, 8%) scale(1.08);
  }
}

@keyframes authGateBlobB {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10%, -5%) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  #authGate::before,
  #authGate::after {
    animation: none;
  }
}

html.etb-authed #authGate {
  display: none !important;
  pointer-events: none;
}

.auth-gate__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 44px 32px 40px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 12px 40px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  isolation: isolate;
}

.auth-gate__brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-gate__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-gate__logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.auth-gate__title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0c0c0e;
  margin: 0 0 6px;
}

.auth-gate__department {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.4;
  color: #636366;
  margin: 0 0 16px;
  text-transform: none;
}

.auth-gate__subtitle {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.45;
  color: #6e6e73;
  margin: 0;
}

.auth-gate__form {
  margin: 0;
}

.auth-gate__fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.auth-gate__field {
  margin-bottom: 8px;
}

.auth-gate__label {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: #6e6e73;
  margin-bottom: 10px;
}

.auth-gate__pin-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 4px;
}

.auth-gate__pin-row--shake {
  animation: authGateShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes authGateShake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
  100% {
    transform: translateX(0);
  }
}

.auth-gate__pin-cell {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  height: 50px;
  padding: 0;
  text-align: center;
  line-height: 50px;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: #0c0c0e;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  transition:
    border-color 0.22s cubic-bezier(0.25, 0.1, 0.25, 1),
    background 0.22s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Şifre benzeri maske (tek karakter + placeholder noktası için text kullanımı) */
.auth-gate__pin-cell--masked {
  -webkit-text-security: disc;
}

.auth-gate__pin-cell::placeholder,
.auth-gate__pin-cell::-webkit-input-placeholder {
  color: #aeaeb2;
  font-size: 17px;
  font-weight: 500;
  opacity: 1;
}

.auth-gate__pin-cell:focus {
  outline: none;
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28);
  background: #ffffff;
}

.auth-gate__pin-cell:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-gate__error {
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  letter-spacing: -0.015em;
  color: #ff3b30;
  margin: 6px 0 0;
  min-height: 1.25em;
}

/* layout.css genel `button` kuralı --radius-sm uygular; #authGate ile ezip büyük radius veriyoruz */
#authGate .auth-gate__submit {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 16px 22px;
  min-height: 52px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  font-family: inherit;
  color: #fff;
  background: #0a84ff;
  border: none !important;
  border-radius: 999px !important;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
  transition:
    background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 0.2s ease,
    transform 0.18s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#authGate .auth-gate__submit:hover {
  background: #0077ed;
}

#authGate .auth-gate__submit:active {
  transform: scale(0.97);
  opacity: 0.94;
}

#authGate .auth-gate__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
