:root {
  --logo-green-top: #3b493b;
  --logo-green: #384638;
  --logo-green-bottom: #333e32;
  --deep-green: #1b291f;
  --gold: #ffd335;
  --gold-light: #ffe98b;
  --gold-dark: #aa7f00;
  --text: #f2f3ed;
  --muted: #aeb9af;
  --line: rgba(255, 255, 255, .12);
  --surface: #1d2b21;
  --white: #fff;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--logo-green-bottom);
  color: var(--text);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: var(--gold); font-weight: 750; text-decoration: none; }
a:hover { color: var(--gold-light); }

.login-shell {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  flex-direction: column;
  background:
    linear-gradient(180deg, var(--logo-green-top) 0%, var(--logo-green) 28%, var(--logo-green-bottom) 48%, var(--surface) 100%);
  box-shadow: 0 0 70px rgba(8, 16, 11, .28);
}

.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .82;
}

.ambient {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ambient-one {
  top: -170px;
  right: -170px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 211, 53, .13);
  box-shadow: 0 0 0 55px rgba(255, 211, 53, .025), 0 0 0 110px rgba(255, 211, 53, .018);
  animation: breathe 7s ease-in-out infinite;
}

.ambient-two {
  top: 165px;
  left: -75px;
  width: 165px;
  height: 165px;
  background: rgba(255, 211, 53, .045);
  filter: blur(2px);
  animation: drift 8s ease-in-out infinite;
}

.brand-header {
  position: relative;
  z-index: 1;
  display: flex;
  height: 320px;
  flex: 0 0 320px;
  align-items: center;
  flex-direction: column;
  padding: max(25px, env(safe-area-inset-top)) 20px 0;
  color: rgba(255, 255, 255, .68);
  text-align: center;
  animation: logoEnter .9s cubic-bezier(.2,.8,.2,1) both;
}

.portal-label {
  color: var(--gold);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .27em;
  text-transform: uppercase;
}

.logo-frame {
  position: relative;
  width: min(390px, 104vw);
  height: 205px;
  margin-top: 2px;
  overflow: hidden;
}

.logo-frame img {
  position: absolute;
  top: -28px;
  left: 0;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(12, 20, 14, .24));
  animation: logoGlow 7.5s ease-in-out infinite;
}

.logo-shine {
  position: absolute;
  top: -28px;
  left: 0;
  z-index: 2;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: linear-gradient(105deg, transparent 28%, rgba(255,255,255,0) 39%, rgba(255,255,255,.95) 48%, rgba(255,239,154,.55) 53%, transparent 64%);
  background-position: 180% 0;
  background-size: 240% 100%;
  filter: drop-shadow(0 0 9px rgba(255, 220, 84, .68));
  pointer-events: none;
  -webkit-mask: url("logo-transparent-native.png?v=20260814-1") center / 100% 100% no-repeat;
  mask: url("logo-transparent-native.png?v=20260814-1") center / 100% 100% no-repeat;
  animation: logoSweep 7s linear infinite;
}

.brand-header p {
  margin: -17px 0 0;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-card {
  position: relative;
  z-index: 3;
  width: calc(100% - 24px);
  max-width: 455px;
  margin: -25px auto 0;
  padding: 18px 24px 27px;
  border: 1px solid rgba(255, 211, 53, .13);
  border-radius: 29px;
  background: linear-gradient(145deg, rgba(48, 67, 50, .96), rgba(25, 39, 29, .98));
  box-shadow: 0 24px 60px rgba(5, 12, 7, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px);
  animation: cardEnter .85s .13s cubic-bezier(.2,.8,.2,1) both;
}

.drag-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .16);
}

.heading { margin-bottom: 25px; text-align: center; }

.welcome-label {
  display: block;
  margin-bottom: 7px;
  color: var(--gold-dark);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.heading h1 {
  margin: 0 0 8px;
  color: #f8f8f2;
  font-size: clamp(1.65rem, 7vw, 2rem);
  letter-spacing: -.045em;
  line-height: 1.08;
}

.heading p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }

.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 137, 119, .28);
  border-radius: 12px;
  background: rgba(122, 42, 34, .28);
  color: #ffcbc4;
  font-size: .83rem;
  line-height: 1.45;
}

.success-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(117, 214, 140, .28);
  border-radius: 12px;
  background: rgba(37, 105, 55, .25);
  color: #c9f3d2;
  font-size: .83rem;
  line-height: 1.45;
}

.field { margin-bottom: 17px; }
.field label { display: block; margin: 0 0 7px 2px; color: #dce4dc; font-size: .78rem; font-weight: 750; }
.control { position: relative; }

.control input {
  width: 100%;
  height: 55px;
  padding: 0 49px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  background: rgba(10, 20, 13, .38);
  color: var(--text);
  font-size: .92rem;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.control input::placeholder { color: #809084; }
.control input:focus { border-color: #d4a719; background: rgba(12, 23, 15, .58); box-shadow: 0 0 0 4px rgba(255, 211, 53, .13); transform: translateY(-1px); }

.user-icon, .lock-icon {
  position: absolute;
  top: 50%;
  left: 18px;
  z-index: 1;
  transform: translateY(-50%);
}

.user-icon { width: 15px; height: 15px; border: 2px solid #607263; border-radius: 50%; }
.user-icon::after { position: absolute; bottom: -8px; left: -5px; width: 21px; height: 10px; border: 2px solid #607263; border-bottom: 0; border-radius: 14px 14px 0 0; content: ""; }
.lock-icon { width: 15px; height: 13px; border: 2px solid #607263; border-radius: 3px; }
.lock-icon::before { position: absolute; top: -9px; left: 1px; width: 9px; height: 9px; border: 2px solid #607263; border-bottom: 0; border-radius: 8px 8px 0 0; content: ""; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}

.password-toggle:hover { background: rgba(255, 255, 255, .07); }
.eye-icon { position: relative; width: 19px; height: 12px; border: 2px solid #718074; border-radius: 50% / 62%; }
.eye-icon::after { position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: #718074; content: ""; transform: translate(-50%, -50%); }
.password-toggle[aria-pressed="true"] .eye-icon::before { position: absolute; top: 4px; left: -3px; width: 23px; height: 2px; background: #718074; content: ""; transform: rotate(-38deg); }

.options { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 1px 1px 23px; font-size: .78rem; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); }

.sign-in-button {
  position: relative;
  display: flex;
  width: 100%;
  height: 57px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid #e9b817;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 13px 27px rgba(174, 128, 0, .2);
  color: #243125;
  cursor: pointer;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease;
}

.sign-in-button::before { position: absolute; top: -80%; left: -40%; width: 35%; height: 250%; background: rgba(255,255,255,.38); content: ""; transform: rotate(25deg); transition: left .55s ease; }
.sign-in-button:hover::before { left: 120%; }
.sign-in-button:hover { box-shadow: 0 17px 34px rgba(174, 128, 0, .28); transform: translateY(-2px); }
.sign-in-button:active { transform: scale(.99); }
.button-arrow { font-size: 1.15rem; transition: transform .18s ease; }
.sign-in-button:hover .button-arrow { transform: translateX(4px); }

.support { margin: 23px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

footer { position: relative; z-index: 2; margin: auto 0 0; padding: 21px 15px max(18px, env(safe-area-inset-bottom)); color: #77857a; font-size: .68rem; text-align: center; }

@keyframes logoEnter { from { opacity: 0; transform: translateY(-20px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cardEnter { from { opacity: 0; transform: translateY(42px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(16px, -12px); } }
@keyframes logoSweep {
  0% { background-position: 180% 0; opacity: .82; }
  100% { background-position: -80% 0; opacity: .82; }
}
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 10px 16px rgba(12, 20, 14, .24)) drop-shadow(0 0 0 rgba(255,211,53,0)); }
  50% { filter: drop-shadow(0 10px 16px rgba(12, 20, 14, .28)) drop-shadow(0 0 10px rgba(255,211,53,.22)); }
}

@media (min-width: 700px) {
  body { padding: 28px; background: #202e24; }
  .login-shell { min-height: calc(100vh - 56px); border: 1px solid rgba(255,255,255,.08); border-radius: 34px; }
}

@media (max-height: 740px) {
  .brand-header { height: 275px; flex-basis: 275px; }
  .logo-frame { width: 335px; height: 175px; }
  .login-card { margin-top: -20px; }
  .heading { margin-bottom: 20px; }
  .field { margin-bottom: 14px; }
}

@media (max-width: 360px) {
  .login-card { width: calc(100% - 16px); padding-right: 19px; padding-left: 19px; }
  .options { align-items: flex-start; flex-direction: column; gap: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
