/* Firekiren royal login — desktop + mobile, no scroll-y — v=fkauth13 */
:root {
  --fk-navy: #000033;
  --fk-gold: #ffd700;
  --fk-gold-2: #e8b923;
  --fk-gold-soft: #ffe9a0;
  --fk-cyan: #00ccff;
  --fk-cyan-soft: #7af0ff;
  --fk-font: "Montserrat", system-ui, sans-serif;
  --fk-display: "Cinzel", "Montserrat", Georgia, serif;
  --fk-dock: 56px;
  --fk-gap: 14px;
  --fk-label-gap: 10px;
  --fk-card-pad-y: 16px;
  --fk-card-pad-x: 16px;
  --fk-main-gap: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body.fk-auth-body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--fk-font);
  color: #fff;
  background: var(--fk-navy);
  -webkit-font-smoothing: antialiased;
}

.fk-auth {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--fk-dock);
  overflow: hidden;
  isolation: isolate;
}

.fk-auth__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #000033;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}
.fk-auth__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(0, 160, 255, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(0, 0, 30, 0.45) 0%, rgba(0, 0, 18, 0.62) 50%, rgba(0, 0, 8, 0.78) 100%);
}

/* Main — flex stack mobile; flex row desktop */
.fk-auth__main {
  position: relative;
  z-index: 2;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--fk-main-gap);
  padding:
    max(10px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    10px
    max(14px, env(safe-area-inset-left));
}

/* Logo hidden on mobile; shown desktop only */
.fk-auth__aside {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.fk-auth__panel {
  flex: 0 1 auto;
  min-width: 0;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Full 3D FIRE Kiren emblem — fill aside (100% × 100%) */
.fk-auth__hero {
  position: relative;
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  filter:
    drop-shadow(0 0 28px rgba(40, 140, 255, 0.55))
    drop-shadow(0 0 14px rgba(255, 200, 60, 0.35))
    drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}
.fk-auth__hero img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center center;
  background: transparent;
}

.fk-auth__welcome {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(8, 12, 32, 0.94), rgba(4, 8, 24, 0.94));
  border: 1.5px solid rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 16px rgba(255, 200, 40, 0.12);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}
.fk-auth__welcome strong {
  color: var(--fk-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}
.fk-auth__welcome span {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--fk-gold-soft);
}

/* Card */
.fk-auth__frame {
  position: relative;
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  padding: 3px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(0, 220, 255, 0.95), rgba(0, 140, 220, 0.55) 40%, rgba(0, 220, 255, 0.9));
  box-shadow:
    0 0 0 1px rgba(120, 240, 255, 0.35),
    0 0 24px rgba(0, 200, 255, 0.28),
    0 16px 36px rgba(0, 0, 0, 0.5);
}
.fk-auth__frame-inner {
  border-radius: 15px;
  padding: var(--fk-card-pad-y) var(--fk-card-pad-x);
  background: linear-gradient(180deg, rgba(8, 16, 48, 0.97), rgba(4, 10, 32, 0.98));
  border: 3px solid var(--fk-gold-2);
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 150, 0.4),
    inset 0 0 20px rgba(0, 40, 80, 0.3);
  overflow: hidden;
}

.fk-auth__alert {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}
.fk-auth__alert--error {
  background: rgba(255, 40, 80, 0.15);
  border: 1px solid rgba(255, 80, 120, 0.45);
  color: #ffb3c4;
}
.fk-auth__alert--ok {
  background: rgba(40, 200, 120, 0.14);
  border: 1px solid rgba(80, 220, 140, 0.4);
  color: #b8f7cf;
}

/* Form + fields: icon left, label above input */
.fk-auth__form {
  display: grid;
  gap: var(--fk-gap);
}

.fk-field {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}
.fk-field__ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, #ffe58a, var(--fk-gold-2) 55%, #9a6b00 100%);
  color: #3a2400;
  box-shadow: 0 0 10px rgba(255, 200, 40, 0.35);
  align-self: end;
  margin-bottom: 5px;
}
.fk-field__ico svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.fk-field__col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fk-field label {
  display: block;
  margin: 0 0 var(--fk-label-gap) 0;
  padding: 0 0 0 2px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fk-gold-soft);
  line-height: 1.25;
}
.fk-field label em {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.7;
  margin-left: 4px;
}
.fk-field__box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  background: #060e28;
  border: 1.5px solid rgba(0, 200, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.1);
  overflow: hidden;
}
.fk-field__box:focus-within {
  border-color: var(--fk-cyan-soft);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.25);
}
.fk-field__box input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
.fk-field__box input::placeholder {
  color: #7d8bab;
  -webkit-text-fill-color: #7d8bab;
  opacity: 1;
}
/* Kill Chrome/Safari autofill white / yellow wash */
.fk-field__box input:-webkit-autofill,
.fk-field__box input:-webkit-autofill:hover,
.fk-field__box input:-webkit-autofill:focus,
.fk-field__box input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  transition: background-color 99999s ease-out;
  box-shadow: 0 0 0 1000px #060e28 inset !important;
  -webkit-box-shadow: 0 0 0 1000px #060e28 inset !important;
  background-color: #060e28 !important;
  background-image: none !important;
  border: 0 !important;
  filter: none;
}
.fk-field__box input:-moz-autofill {
  background: #060e28 !important;
  color: #fff !important;
}
.fk-field__toggle {
  border: 0;
  background: transparent;
  color: #c9d4ea;
  padding: 4px;
  margin: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fk-field__toggle svg {
  width: 18px;
  height: 18px;
}

.fk-auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 0;
  padding: 0 0 0 46px; /* align under input column */
}
.fk-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.fk-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--fk-cyan);
}
.fk-forgot {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fk-cyan-soft);
  text-decoration: none;
}
.fk-forgot:hover { text-decoration: underline; }

.fk-auth__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 6px 0 0;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  clip-path: polygon(3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1200;
  background: linear-gradient(180deg, #ffe56a 0%, var(--fk-gold) 42%, var(--fk-gold-2) 78%, #b8860b 100%);
  box-shadow:
    0 4px 0 #8a6500,
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.fk-auth__submit:hover { filter: brightness(1.05); }
.fk-auth__submit:active { transform: translateY(1px); }
.fk-auth__submit svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.fk-auth__note {
  margin: 10px 0 0;
  padding: 0 4px;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fk-gold-soft);
}
.fk-auth__note + .fk-auth__note {
  margin-top: 6px;
}
.fk-auth__note a {
  color: var(--fk-cyan-soft);
  font-weight: 800;
  text-decoration: none;
}
.fk-auth__note--shield {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
}
.fk-auth__note--shield svg,
.fk-auth__note svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 2px;
  fill: var(--fk-gold);
  vertical-align: -1px;
}

/* Bottom dock */
.fk-auth__dock {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  min-height: var(--fk-dock);
  height: var(--fk-dock);
  padding:
    4px
    max(10px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(4, 8, 28, 0.95), rgba(2, 4, 16, 0.98));
  border-top: 1px solid rgba(255, 215, 0, 0.35);
}
.fk-auth__dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  margin: 0;
  padding: 4px;
  text-decoration: none;
  color: var(--fk-gold-soft);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.fk-auth__dock a:hover { color: #fff; }
.fk-auth__dock svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.35));
}

/* ========== Desktop: flex — logo LEFT · gap · form RIGHT ========== */
@media (min-width: 900px) {
  :root {
    --fk-dock: 60px;
    --fk-gap: 16px;
    --fk-label-gap: 12px;
    --fk-card-pad-y: 22px;
    --fk-card-pad-x: 24px;
    --fk-main-gap: clamp(48px, 7vw, 96px);
  }

  .fk-auth__bg {
    background-size: cover;
    background-position: center 30%;
    filter: saturate(0.92);
  }
  .fk-auth__veil {
    background:
      linear-gradient(90deg, rgba(0, 0, 24, 0.35) 0%, rgba(0, 0, 18, 0.55) 42%, rgba(0, 0, 10, 0.82) 100%),
      linear-gradient(180deg, rgba(0, 0, 28, 0.4) 0%, rgba(0, 0, 10, 0.75) 100%);
  }

  .fk-auth__main {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--fk-main-gap);
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 20px clamp(36px, 6vw, 80px);
  }

  .fk-auth__aside {
    display: flex;
    flex: 1 1 auto;
    width: auto;
    max-width: 58%;
    min-width: 0;
    height: 100%;
    align-self: stretch;
    align-items: center;
  }

  .fk-auth__panel {
    flex: 0 0 auto;
    width: min(460px, 40vw);
    max-width: 460px;
    margin-left: auto;
    align-items: stretch;
    gap: 14px;
  }

  .fk-auth__welcome {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95rem;
  }
  .fk-auth__welcome span {
    margin-top: 5px;
    font-size: 0.8rem;
  }

  .fk-auth__frame {
    width: 100%;
  }

  .fk-field {
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
  }
  .fk-field__ico {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
  }
  .fk-field__ico svg {
    width: 17px;
    height: 17px;
  }
  .fk-field label {
    margin: 0 0 var(--fk-label-gap) 0;
    font-size: 0.76rem;
    letter-spacing: 0.14em;
  }
  .fk-field__box {
    min-height: 48px;
    padding: 0 14px;
  }
  .fk-field__box input {
    font-size: 0.95rem;
    padding: 12px 0;
  }

  .fk-auth__row {
    padding-left: 52px;
    margin-top: 4px;
  }
  .fk-check,
  .fk-forgot { font-size: 0.84rem; }

  .fk-auth__submit {
    min-height: 52px;
    margin-top: 8px;
    font-size: 1.05rem;
  }

  .fk-auth__note {
    margin-top: 12px;
    font-size: 0.72rem;
  }
  .fk-auth__note + .fk-auth__note {
    margin-top: 8px;
  }

  .fk-auth__dock {
    padding-inline: clamp(28px, 5vw, 64px);
  }
  .fk-auth__dock a { font-size: 0.72rem; gap: 5px; }
  .fk-auth__dock svg { width: 20px; height: 20px; }
}

/* Short viewports — keep no scroll, tighten evenly */
@media (max-height: 760px) {
  :root {
    --fk-gap: 10px;
    --fk-card-pad-y: 12px;
  }
  .fk-auth__main { gap: 10px; padding-block: 6px; }
  .fk-auth__welcome { padding: 7px 12px; font-size: 0.8rem; }
  .fk-auth__welcome span { font-size: 0.68rem; }
  .fk-field__box { min-height: 40px; }
  .fk-auth__submit { min-height: 44px; }
}

@media (max-height: 640px) {
  .fk-auth__hero { display: none; }
  .fk-auth__welcome span { display: none; }
  .fk-auth__main { gap: 6px; }
  :root {
    --fk-gap: 8px;
    --fk-label-gap: 4px;
    --fk-card-pad-y: 10px;
  }
}

@media (max-width: 380px) {
  .fk-auth__row { padding-left: 42px; }
  .fk-auth__dock a span { font-size: 0.56rem; }
}
