:root {
  --gate-gold: #d7ad5b;
  --gate-gold-hot: #ffe59a;
  --gate-cyan: #55ddff;
  --gate-navy: #03101e;
  --gate-ivory: #fff4d6;
  --gate-ease: cubic-bezier(.2, .8, .2, 1);
}

body { overflow: hidden; }

.scene { filter: saturate(.93) contrast(1.02); }
.shade {
  background:
    radial-gradient(circle at 69% 51%, transparent 0 17%, rgba(1, 5, 12, .08) 39%, rgba(1, 5, 12, .3) 72%),
    linear-gradient(90deg, rgba(1, 5, 13, .64), rgba(1, 5, 13, .18) 39%, rgba(1, 5, 13, .03) 68%, rgba(1, 5, 13, .22)),
    linear-gradient(0deg, rgba(1, 5, 13, .72), transparent 31%);
}

.topbar {
  height: 100px;
  padding: 0 clamp(34px, 4.2vw, 80px);
}

.brand { width: clamp(185px, 12vw, 230px); }
.brand img { display: block; width: 100%; height: auto; filter: drop-shadow(0 7px 15px rgba(0, 0, 0, .48)); }

.crossroads-button {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(215, 173, 91, .88);
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(circle, rgba(32, 162, 205, .2), rgba(3, 14, 26, .96) 65%);
  color: var(--gate-ivory);
  box-shadow: inset 0 0 0 2px rgba(57, 201, 236, .2), 0 0 0 5px rgba(2, 12, 22, .42), 0 8px 18px rgba(0, 0, 0, .42);
  transition: transform .18s var(--gate-ease), filter .18s, box-shadow .18s;
}

.crossroads-button::after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(72, 207, 240, .32);
  clip-path: inherit;
}

.crossroads-button:hover,
.crossroads-button:focus-visible {
  outline: 0;
  transform: translateX(-3px) scale(1.05);
  filter: brightness(1.12);
  box-shadow: inset 0 0 0 2px rgba(76, 221, 255, .32), 0 0 18px rgba(62, 212, 247, .28), 0 9px 20px rgba(0, 0, 0, .45);
}

.crossroads-button:active { transform: translate(-1px, 1px) scale(.94); }
.crossroads-gem {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--gate-gold-hot);
  transform: rotate(45deg);
  background: radial-gradient(circle, #d8fbff 0 8%, #39dfff 12% 27%, #0879ac 31% 57%, #031523 61%);
  color: white;
  box-shadow: 0 0 12px rgba(59, 220, 255, .62);
}

.crossroads-gem::before { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(255, 231, 163, .58); }
.crossroads-arrow { position: relative; z-index: 1; display: block; transform: rotate(-45deg) translate(1px, -1px); color: #fff7dc; font: 700 28px/1 Georgia, serif; text-shadow: 0 0 8px #43dcff; }

.language { position: relative; }
.language::before { content: 'LANGUAGE'; position: absolute; right: 8px; top: -12px; color: #65dff7; font-size: 6px; font-weight: 900; letter-spacing: 1.4px; }
.language select {
  width: 82px;
  height: 48px;
  border: 1px solid rgba(215, 173, 91, .78);
  border-radius: 0;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  background: linear-gradient(#0a2638, #04121f);
  box-shadow: inset 0 0 0 2px rgba(53, 205, 239, .14), 0 7px 17px rgba(0, 0, 0, .38);
  cursor: pointer;
}

main {
  min-height: calc(100vh - 154px);
  grid-template-columns: minmax(360px, .9fr) minmax(500px, 1fr);
  gap: clamp(42px, 7vw, 135px);
  padding: 12px clamp(34px, 6vw, 116px) 58px;
}

.intro { align-self: center; margin: -1vh 0 0; max-width: 560px; }
.intro-logo { width: clamp(360px, 31vw, 540px); filter: none; }
.intro-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 13px 25px rgba(0, 0, 0, .7)); }

.auth {
  position: relative;
  width: min(570px, 100%);
  padding: 34px 48px 28px;
  border: 1px solid rgba(215, 173, 91, .62);
  clip-path: polygon(18px 0, calc(50% - 30px) 0, 50% 21px, calc(50% + 30px) 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  background:
    radial-gradient(circle at 50% 0, rgba(38, 185, 226, .2), transparent 25%),
    linear-gradient(145deg, rgba(5, 23, 39, .96), rgba(1, 9, 18, .96));
  box-shadow: inset 0 0 0 2px rgba(47, 193, 229, .13), inset 0 -55px 100px rgba(0, 0, 0, .3), 0 28px 70px rgba(0, 0, 0, .48);
}

.auth::after {
  content: '';
  position: absolute;
  inset: 9px;
  z-index: -1;
  border: 1px solid rgba(58, 203, 238, .19);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  pointer-events: none;
}

.gate-crown {
  position: absolute;
  left: 50%;
  top: -24px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  transform: translateX(-50%) rotate(45deg);
  border: 2px solid var(--gate-gold-hot);
  background: radial-gradient(circle, #e2fdff 0 8%, #3de0ff 10% 25%, #0878af 29% 57%, #031421 61%);
  color: white;
  font-size: 9px;
  box-shadow: 0 0 22px rgba(56, 218, 255, .72), inset 0 0 0 5px rgba(2, 13, 24, .6);
}

.auth-heading { padding-bottom: 14px; border-bottom: 1px solid rgba(215, 173, 91, .24); }
.portal-label { margin-bottom: 7px; font-size: 10px; letter-spacing: 4px; }
.auth h2 { color: var(--gate-ivory); font-size: 34px; text-shadow: 0 4px 11px #000; }
.mode-switch { margin: 16px 0 13px; border-bottom-color: rgba(215, 173, 91, .26); }
.mode { position: relative; height: 43px; color: #91aeba; font: 700 14px/1 Georgia, serif; letter-spacing: .3px; transition: color .16s, background .16s; }
.mode:hover { color: #d9f6fb; background: linear-gradient(0deg, rgba(45, 190, 226, .1), transparent); }
.mode.active { color: var(--gate-ivory); border-color: var(--gate-cyan); text-shadow: 0 0 9px rgba(65, 219, 252, .26); }
.mode.active::after { content: ''; position: absolute; left: 32%; right: 32%; bottom: -2px; height: 2px; background: #d8faff; box-shadow: 0 0 10px var(--gate-cyan); }

.google-auth {
  height: 50px;
  border: 1px solid rgba(215, 173, 91, .62);
  border-radius: 2px;
  background: linear-gradient(#f9fbfc, #dce7eb);
  box-shadow: 0 6px 15px rgba(0, 0, 0, .28), inset 0 0 0 2px white;
  transition: transform .16s, filter .16s, box-shadow .16s;
}
.google-auth:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 0 14px rgba(65, 216, 249, .22), 0 8px 17px rgba(0, 0, 0, .34); }
.google-auth:active { transform: translateY(1px) scale(.99); }
.google-mark { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #b8c6d1; border-radius: 50%; background: white; }
.divider { margin: 13px 0; font-size: 11px; }
.divider::before, .divider::after { background: linear-gradient(90deg, transparent, rgba(83, 208, 239, .38)); }
.divider::after { transform: scaleX(-1); }

.field { margin-bottom: 13px; }
.field > label { margin: 0 0 6px 3px; color: #e8ecdf; font: 700 12px/1 Georgia, serif; letter-spacing: .4px; }
.field input {
  height: 50px;
  border: 1px solid rgba(74, 166, 200, .46);
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(7, 26, 43, .96), rgba(4, 18, 31, .92));
  box-shadow: inset 0 0 0 1px rgba(215, 173, 91, .07), inset 0 7px 16px rgba(0, 0, 0, .16);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.field input:hover { border-color: rgba(107, 211, 235, .62); }
.field input:focus { border-color: var(--gate-gold-hot); background: rgba(5, 25, 42, .98); box-shadow: inset 0 0 0 1px rgba(78, 220, 250, .2), 0 0 15px rgba(48, 203, 237, .18); }
.field input.invalid { border-color: #ff947c; box-shadow: 0 0 12px rgba(255, 111, 82, .19); }
.text-action { right: 9px; color: #6ce6ff; font-size: 12px; }
.text-action:hover { color: white; text-shadow: 0 0 8px var(--gate-cyan); }

.form-options { font-size: 12px; }
.remember input { appearance: none; position: relative; width: 18px; height: 18px; border: 1px solid #69dff6; background: #061827; cursor: pointer; }
.remember input:checked { background: linear-gradient(145deg, #70eaff, #159bc0); box-shadow: 0 0 8px rgba(71, 220, 251, .42); }
.remember input:checked::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #04101d; font-size: 13px; font-weight: 1000; }
.link-button { color: #f0cb72; font-size: 12px; }
.link-button:hover { color: #ffe9a4; text-shadow: 0 0 8px rgba(255, 218, 116, .28); }

.auth .primary,
.auth .secondary {
  position: relative;
  height: 54px;
  overflow: hidden;
  border-radius: 0;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  transition: transform .18s var(--gate-ease), filter .18s, box-shadow .18s;
}
.auth .primary {
  border: 1px solid var(--gate-gold-hot);
  background: linear-gradient(180deg, #18a8cf, #07617f);
  box-shadow: inset 0 0 0 2px rgba(197, 250, 255, .2), inset 0 -16px 25px rgba(0, 26, 45, .27), 0 8px 19px rgba(0, 0, 0, .38);
}
.auth .primary::before { content: ''; position: absolute; top: -80%; left: -30%; width: 18%; height: 250%; transform: rotate(18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); opacity: 0; }
.auth .primary:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: inset 0 0 0 2px rgba(211, 252, 255, .3), 0 0 19px rgba(55, 214, 247, .4), 0 10px 20px rgba(0, 0, 0, .45); }
.auth .primary:hover::before { opacity: 1; animation: gate-sheen .7s ease-out both; }
.auth .primary:active { transform: translateY(1px) scale(.988); filter: brightness(.9); }
.auth .secondary { margin-top: 9px; border: 1px solid rgba(215, 173, 91, .48); background: linear-gradient(#0a2435, #04111e); color: #e9e6d9; box-shadow: inset 0 0 0 2px rgba(53, 202, 237, .1), 0 6px 16px rgba(0, 0, 0, .32); }
.auth .secondary:hover { transform: translateY(-1px); border-color: var(--gate-gold-hot); color: white; box-shadow: inset 0 0 0 2px rgba(55, 211, 246, .17), 0 0 15px rgba(47, 203, 237, .2); }
.auth .secondary:active { transform: translateY(1px) scale(.99); }
.status { color: #70e5fb; font-size: 11px; }

footer { height: 54px; border-top: 1px solid rgba(215, 173, 91, .22); background: linear-gradient(90deg, rgba(1, 7, 14, .7), transparent 40%, rgba(1, 7, 14, .58)); }
.footer-brand { display: flex; align-items: center; }
.footer-brand img { width: 92px; height: auto; opacity: .84; }
@keyframes gate-sheen { from { transform: translateX(0) rotate(18deg); } to { transform: translateX(750%) rotate(18deg); } }

@media (max-height: 820px) and (min-width: 901px) {
  .topbar { height: 72px; }
  .brand { width: 160px; }
  .crossroads-button { width: 48px; height: 48px; }
  .language select { height: 42px; }
  main { min-height: calc(100vh - 112px); padding-top: 0; padding-bottom: 18px; }
  .intro-logo { width: 350px; }
  .auth { width: 500px; padding: 20px 39px 14px; }
  .gate-crown { width: 36px; height: 36px; top: -18px; }
  .auth-heading { padding-bottom: 7px; }
  .auth h2 { font-size: 26px; }
  .mode-switch { margin: 7px 0; }
  .google-auth { height: 40px; }
  .divider { margin: 6px 0; }
  .field { margin-bottom: 7px; }
  .field input { height: 42px; }
  .form-options { margin-bottom: 6px; }
  .auth .primary, .auth .secondary { height: 42px; }
  .auth .secondary { margin-top: 6px; }
  footer { height: 40px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  body { overflow: hidden; }
  .topbar { height: 52px; padding: 0 18px; }
  .brand { display: block; width: 105px; }
  .crossroads-button { width: 37px; height: 37px; }
  .crossroads-gem { width: 23px; height: 23px; }
  .crossroads-arrow { font-size: 20px; }
  .language::before { display: none; }
  .language select { width: 55px; height: 34px; padding: 0 7px; font-size: 10px; }
  main { height: calc(100vh - 79px); min-height: 0; overflow: hidden; grid-template-columns: minmax(220px, .7fr) minmax(380px, 1fr); gap: 28px; padding: 0 22px 8px; }
  .intro-logo { width: 235px; }
  .auth { width: 405px; max-height: calc(100vh - 85px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2385a3 transparent; padding: 10px 27px 7px; }
  .gate-crown { display: none; }
  .auth-heading { padding-bottom: 4px; }
  .portal-label { margin-bottom: 2px; font-size: 6px; }
  .auth h2 { font-size: 20px; }
  .mode-switch { margin: 4px 0; }
  .mode { height: 27px; font-size: 9px; }
  .google-auth { height: 30px; font-size: 10px; }
  .google-mark { width: 20px; height: 20px; font-size: 13px; }
  .divider { margin: 4px 0; font-size: 7px; }
  .field { margin-bottom: 4px; }
  .field > label { margin-bottom: 3px; font-size: 8px; }
  .field input { height: 31px; padding-inline: 9px; font-size: 10px; }
  .text-action { top: 0; height: 31px; font-size: 8px; }
  .form-options { min-height: 24px; margin: 0 0 3px; font-size: 8px; }
  .remember input { width: 13px; height: 13px; }
  .link-button { font-size: 8px; }
  .auth .primary, .auth .secondary { height: 31px; font-size: 9px; }
  .auth .secondary { margin-top: 3px; }
  footer { height: 27px; font-size: 7px; }
  .footer-brand img { width: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth .primary::before { animation: none !important; }
}
