/* Auth V2 — brand-wordmark + login/register frames (oran korunur) */

html, body.ko-auth-body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: Inter, "Segoe UI", sans-serif;
  color: #f2ead8;
  background: #0a0610;
  font-size: 15px;
}

.ko-login-screen {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  box-sizing: border-box;
  overflow: hidden;
}

.ko-login-screen__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0a0610 url("/img/ui/auth-battle-bg.jpg") center / cover no-repeat;
}

.ko-login-screen__content {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* 1200×380 — stretch yok */
.ko-login-wordmark {
  width: min(460px, 68vw, calc(18vh * 1200 / 380));
  height: auto;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.ko-login-frame {
  position: relative;
  display: block;
  box-sizing: border-box;
  flex: 0 0 auto;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45));
}

/* 800×900 — kalan yüksekliğe göre genişlik; esnetme yok */
.ko-login-frame--login {
  width: min(440px, 92vw, calc((100dvh - 8.5rem) * 800 / 900));
}

/* 800×1100 */
.ko-login-frame--register {
  width: min(420px, 92vw, calc((100dvh - 8.5rem) * 800 / 1100));
}

.ko-login-frame__img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Güvenli iç alan */
.ko-login-frame__inner {
  position: absolute;
  inset: 15% 14% 12%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.ko-login-frame--register .ko-login-frame__inner {
  inset: 11% 13% 9%;
}

.ko-login-form {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.ko-login-form--register {
  max-width: 300px;
  gap: 0.28rem;
}

.ko-login-form .ko-alert {
  width: 100%;
  margin: 0;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  background: rgba(30, 8, 8, 0.85);
  border: 1px solid #8a3030;
  color: #f0b0b0;
  box-sizing: border-box;
}

.ko-login-field {
  width: 100%;
  margin: 0;
}

.ko-login-field label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
  color: #e8d9b0;
}

.ko-login-field__box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0 0.55rem;
  border: 1px solid #c9a84c;
  background: #000;
  box-sizing: border-box;
}

.ko-login-form--register .ko-login-field__box {
  min-height: 42px;
}

.ko-login-field__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: center / contain no-repeat;
}

.ko-login-field__icon--user { background-image: url("/img/ui/icon-user-gold.svg"); }
.ko-login-field__icon--lock { background-image: url("/img/ui/icon-lock-gold.svg"); }

.ko-login-field__box input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent !important;
  color: #f2e6c0;
  padding: 0.4rem 0;
  font-size: 1rem;
  font-family: Inter, "Segoe UI", sans-serif;
}

.ko-login-field__box input:focus { outline: none; }
.ko-login-field__box input::placeholder { color: #8a8470; }

/* Chrome autofill beyaz arka plan */
.ko-login-field__box input:-webkit-autofill,
.ko-login-field__box input:-webkit-autofill:hover,
.ko-login-field__box input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f2e6c0;
  caret-color: #f2e6c0;
  box-shadow: 0 0 0 1000px #000 inset;
  transition: background-color 99999s ease-out;
}

.ko-login-field span[data-valmsg-for],
.ko-login-field .field-validation-error {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.72rem;
  color: #e08080;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
}

.ko-login-check {
  width: 100%;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.9rem;
  color: #e0d4b8;
}

.ko-login-check input { accent-color: #8a2020; }

/* 480×96 primary — stretch yok */
.ko-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(250px, 100%);
  align-self: center;
  aspect-ratio: 480 / 96;
  max-height: 40px;
  min-height: 32px;
  margin: 0.05rem auto 0;
  padding: 0 0.5rem;
  border: 0;
  background: transparent url("/img/ui/btn-primary-login.png") center / contain no-repeat;
  color: #fff8e0;
  font-family: Inter, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 1px 3px #000;
}

.ko-login-btn:hover { filter: brightness(1.05); }

.ko-login-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.05rem;
}

/* 400×80 secondary */
.ko-login-btn--nav {
  width: min(220px, 100%);
  aspect-ratio: 400 / 80;
  max-height: 36px;
  min-height: 32px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  background-image: url("/img/ui/btn-secondary-nav.png");
}

@media (min-height: 820px) {
  .ko-login-wordmark { width: min(560px, 70vw, calc(24vh * 1200 / 380)); }
  .ko-login-frame--login { width: min(480px, 92vw, calc((100dvh - 10rem) * 800 / 900)); }
  .ko-login-frame--register { width: min(460px, 92vw, calc((100dvh - 10rem) * 800 / 1100)); }
  .ko-login-field__box { min-height: 42px; }
  .ko-login-form--register .ko-login-field__box { min-height: 42px; }
  .ko-login-btn { max-height: 48px; font-size: 0.95rem; }
  .ko-login-btn--nav { max-height: 40px; font-size: 0.9rem; }
  .ko-login-form { gap: 0.4rem; }
  .ko-login-form--register { gap: 0.28rem; }
  .ko-login-frame__inner { inset: 16% 15% 13%; }
  .ko-login-frame--register .ko-login-frame__inner { inset: 12% 14% 10%; }
}

@media (max-width: 600px) {
  .ko-login-wordmark { width: min(340px, 88vw); }
  .ko-login-frame--login { width: min(360px, 92vw); }
  .ko-login-frame--register { width: min(340px, 90vw); }
  .ko-login-frame__inner { inset: 14% 12% 11%; }
  .ko-login-frame--register .ko-login-frame__inner { inset: 10% 12% 8%; }
  .ko-login-form,
  .ko-login-form--register { max-width: 100%; }
  .ko-login-screen { padding: 0.35rem; overflow-y: auto; overflow-x: hidden; }
  html, body.ko-auth-body { overflow-x: hidden; overflow-y: auto; }
}
