:root {
  --blue-deep: #061f48;
  --gold: #b87522;
  --gold-light: #efbc65;
  --brown: #3b1f0f;
  --ink: #162235;
  --muted: #68778c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body { background: #071f45; color: var(--ink); }
button, input { font: inherit; }

.login-page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

.horse-image {
  position: fixed;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.page-shade {
  position: fixed;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1,14,38,.42) 0%, rgba(2,15,38,.04) 39%, rgba(2,13,32,.42) 100%),
    radial-gradient(circle at center, transparent 32%, rgba(1,10,26,.18) 100%);
}

.market-shell {
  width: min(1500px, calc(100% - 28px));
  margin: 12px auto 0;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 22px;
  background: rgba(5,26,57,.80);
  box-shadow: 0 18px 54px rgba(0,0,0,.30);
  backdrop-filter: blur(18px) saturate(1.15);
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 0 44px 8px;
  color: white;
}

.market-header > div { display: flex; align-items: baseline; gap: 12px; }
.market-kicker { color: var(--gold-light); font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.market-header strong { font-family: Georgia, serif; font-size: 18px; }
.development-label {
  padding: 4px 9px;
  border: 1px solid rgba(239,188,101,.32);
  border-radius: 999px;
  color: #ffe2ad;
  background: rgba(160,91,13,.18);
  font-size: 9px;
  font-weight: 800;
}

.market-carousel { display: flex; align-items: center; gap: 8px; }
.market-viewport {
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.market-viewport::-webkit-scrollbar { display: none; }

.market-track { display: flex; gap: 14px; min-width: max-content; }

.market-card {
  flex: 0 0 292px;
  min-height: 126px;
  display: grid;
  grid-template-columns: 105px 1fr;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255,255,255,.97), rgba(238,244,250,.92));
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

.market-card__art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.26), transparent 34%),
              linear-gradient(145deg, #965b18, #d89e48);
}
.market-card__art > span {
  position: relative;
  z-index: 2;
  font-size: 46px;
  transform: translateY(-8px);
  filter: drop-shadow(0 5px 7px rgba(0,0,0,.23));
}

.mini-chart {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  height: 32px;
  display: flex;
  align-items: end;
  gap: 4px;
  opacity: .72;
}
.mini-chart i {
  flex: 1;
  min-height: 5px;
  border-radius: 2px 2px 0 0;
  background: rgba(255,255,255,.84);
}

.market-card__content {
  min-width: 0;
  padding: 12px 13px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.market-card__eyebrow { color: #8c6a3e; font-size: 8px; font-weight: 900; letter-spacing: .10em; }
.market-card__content strong { margin-top: 3px; color: var(--brown); font-family: Georgia, serif; font-size: 16px; }
.market-card__content b { margin-top: 4px; color: var(--blue-deep); font-size: 19px; white-space: nowrap; }
.market-change { margin-top: 3px; font-size: 11px; font-weight: 850; }
.market-change--up { color: #18864b; }
.market-change--down { color: #ba3030; }
.market-change--neutral { color: #356a9c; }
.market-card__content small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-arrow {
  flex: 0 0 36px;
  width: 36px;
  height: 56px;
  border: 1px solid rgba(255,255,255,.27);
  border-radius: 13px;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 30px;
  transition: .18s ease;
}
.carousel-arrow:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }

.login-stage {
  flex: 1;
  min-height: 500px;
  padding: 22px 7vw 34px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.login-card {
  width: min(430px, 100%);
  margin-right: 5vw;
  padding: 22px 27px 24px;
  border: 1px solid rgba(255,255,255,.60);
  border-radius: 25px;
  background: rgba(255,255,255,.87);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
  backdrop-filter: blur(19px) saturate(1.15);
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(58,45,34,.12);
}
.brand-mini img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(66,36,18,.20);
}
.brand-mini strong, .brand-mini span { display: block; }
.brand-mini strong { color: var(--brown); font-family: Georgia, serif; font-size: 19px; }
.brand-mini span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.login-heading { padding: 18px 0 11px; text-align: center; }
.login-heading > span { color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.login-heading h1 { margin: 5px 0 4px; color: var(--blue-deep); font-size: 26px; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }

.alert {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #f1b4b4;
  border-radius: 11px;
  background: #fff1f1;
  color: #9f2525;
  font-size: 13px;
  font-weight: 650;
}

form label { display: block; margin: 12px 0 6px; color: #344258; font-size: 12px; font-weight: 800; }

.field {
  min-height: 49px;
  display: flex;
  align-items: center;
  border: 1px solid #c4d0de;
  border-radius: 13px;
  background: rgba(255,255,255,.92);
}
.field:focus-within { border-color: #0d5ca8; box-shadow: 0 0 0 4px rgba(13,92,168,.11); }
.field span { width: 46px; text-align: center; color: var(--gold); font-size: 15px; }
.field input {
  flex: 1;
  min-width: 0;
  height: 47px;
  padding: 0 14px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.login-submit {
  width: 100%;
  min-height: 51px;
  margin-top: 19px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #925414, #d49a43);
  box-shadow: 0 12px 24px rgba(116,68,15,.30);
  font-size: 15px;
  font-weight: 850;
}
.login-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }

.restricted-note {
  margin-top: 15px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(235,241,247,.88);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
}
.restricted-note strong, .restricted-note span { display: block; }
.restricted-note strong { color: var(--blue-deep); }

.login-footer {
  padding: 0 16px 11px;
  color: rgba(255,255,255,.78);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
  font-size: 10px;
}

@media (max-width: 980px) {
  .login-stage { justify-content: center; padding-left: 18px; padding-right: 18px; }
  .login-card { margin-right: 0; }
  .market-card { flex-basis: 270px; grid-template-columns: 96px 1fr; }
}

@media (max-width: 620px) {
  .horse-image { object-position: 40% center; }
  .market-shell { width: calc(100% - 16px); margin-top: 8px; padding: 9px 8px 10px; border-radius: 17px; }
  .market-header { padding: 0 36px 7px; align-items: flex-start; }
  .market-header > div { display: block; }
  .market-header strong { display: block; font-size: 15px; }
  .development-label { max-width: 120px; text-align: right; font-size: 8px; }
  .market-card { flex-basis: calc(100vw - 98px); max-width: 300px; }
  .carousel-arrow { flex-basis: 29px; width: 29px; height: 50px; border-radius: 10px; font-size: 25px; }
  .login-stage { min-height: auto; padding: 22px 13px 28px; }
  .login-card { padding: 20px 18px 21px; border-radius: 20px; }
  .login-heading h1 { font-size: 23px; }
}

@media (max-width: 390px) {
  .development-label { display: none; }
  .market-card { flex-basis: calc(100vw - 90px); }
}
