:root {
  --cream: #F6EBDD;
  --card: #FBF6EE;
  --chocolate: #2C1E10;
  --brown: #3A2918;
  --gold: #C4A574;
  --caramel: #9A7044;
  --ink: #241A10;
  --muted: #8d7b68;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Outfit, "Segoe UI", sans-serif;
  --script: "Great Vibes", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.gate {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  background: #1a120c;
}
button, input { font: inherit; color: inherit; }
a { color: var(--caramel); text-decoration: none; }
img, svg { display: block; }
h1, h2, .gate-word { font-family: var(--serif); font-weight: 500; }

.gate-scene {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #1a120c url("../images/login/phone-portrait.jpg") center / cover no-repeat;
  position: relative;
}
.gate-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 14, 8, .72) 0%, rgba(22, 14, 8, .18) 38%, rgba(22, 14, 8, .55) 100%);
  pointer-events: none;
}
.gate-side { display: contents; }
.gate-brand, .gate-stage, .gate-features, .gate-foot { position: relative; z-index: 1; }

.gate-brand { color: #fff; text-align: center; padding: 28px 22px 6px; text-shadow: 0 1px 10px rgba(20, 10, 4, .4); }
.gate-mark { width: 54px; height: 54px; margin: 0 auto 6px; color: var(--gold); }
.gate-mark svg { width: 100%; height: 100%; }
.gate-word { margin: 0; font-size: 58px; line-height: 1; letter-spacing: -0.03em; text-transform: lowercase; }
.gate-kicker {
  margin: 6px 0 0;
  font-size: 13px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
}
.gate-est { margin: 8px 0 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.82); }
.gate-est span { margin: 0 6px; color: var(--gold); }
.gate-brand h1 { margin: 16px 0 0; font-size: 28px; line-height: 1.15; font-weight: 500; }
.gate-legacy { margin: 8px auto 0; max-width: 280px; font-size: 13px; color: rgba(255,255,255,.86); }

.gate-features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 14px 12px 8px;
  color: #f6ebdd;
  text-align: center;
}
.gate-features li { min-width: 0; }
.gate-features strong, .gate-foot strong { display: block; font-weight: 400; font-size: 11px; line-height: 1.25; }
.gate-features em, .gate-foot em { display: none; font-style: normal; }
.gate-badge {
  width: 42px; height: 42px; margin: 0 auto 6px;
  border: 1px solid rgba(196, 165, 116, .75);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold);
}
.gate-customer .gate-badge { background: transparent; }
.gate-admin .gate-badge { background: rgba(20, 12, 8, .42); color: #f3e6cf; }
.gate-badge svg { width: 18px; height: 18px; }

.gate-foot { display: none; }
.gate-script { display: none; }
.gate-card-brand { display: none; }

.gate-stage {
  order: 2;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 16px 22px;
}
.gate-features { order: 3; }
.gate-admin .gate-features { order: 2; }
.gate-admin .gate-stage { order: 3; }

.gate-card {
  width: min(440px, 100%);
  background: var(--card);
  color: var(--ink);
  border-radius: 26px;
  padding: 26px 22px 22px;
  box-shadow: 0 18px 50px rgba(36, 26, 16, .18);
  position: relative;
  overflow: hidden;
}
.gate-card::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -40px; top: -50px;
  border: 1px solid rgba(196, 165, 116, .35);
  border-radius: 50%;
  pointer-events: none;
}
.gate-card > * { position: relative; z-index: 1; }
.gate-card h2 { margin: 0; text-align: center; font-size: 36px; line-height: 1; }
.gate-lede { margin: 8px auto 16px; max-width: 320px; text-align: center; color: var(--muted); font-size: 13.5px; }

.gate-field {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid #eadfce;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.gate-field:focus-within { border-color: var(--gold); }
.gate-field-icon { color: var(--caramel); }
.gate-field-icon svg, .gate-eye svg, .gate-submit svg { width: 18px; height: 18px; }
.gate-field-copy { display: flex; flex-direction: column; min-width: 0; }
.gate-field-copy span { font-size: 11px; color: var(--muted); }
.gate-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 1px 0 0;
  font-size: 15px;
}
.gate-field input::placeholder { color: #b3a394; }
.gate-eye {
  border: 0; background: transparent; padding: 4px; cursor: pointer; color: var(--muted);
}
.gate-eye .eye-shut { display: none; }
.gate-eye.is-on .eye-open { display: none; }
.gate-eye.is-on .eye-shut { display: block; }

.gate-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 14px; font-size: 13px; }
.gate-check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.gate-check input { accent-color: var(--caramel); width: 16px; height: 16px; }
.gate-meta a { color: var(--caramel); }

.gate-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--caramel);
  color: #fff;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  letter-spacing: .02em;
}
.gate-submit:hover { background: #86603a; }
.gate-register { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.gate-register a { color: var(--caramel); font-weight: 500; }

.alert { padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; background: #f3e7d4; font-size: 13px; }
.alert-error { background: #f3dfd6; }
.alert pre { white-space: pre-wrap; margin: 6px 0 0; font-family: inherit; }

/* Phone landscape */
@media (orientation: landscape) and (max-height: 540px) {
  .gate-scene {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    background: #F4EADF url("../images/login/phone-landscape.jpg") left center / 54% 100% no-repeat;
  }
  .gate-scene::before { width: 54%; background: linear-gradient(180deg, rgba(18,10,6,.62), rgba(18,10,6,.2) 42%, rgba(18,10,6,.72)); }
  .gate-side { display: flex; flex-direction: column; min-height: 100dvh; }
  .gate-brand { text-align: left; padding: 18px 22px 0; }
  .gate-mark { margin: 0 0 4px; width: 36px; height: 36px; }
  .gate-word { font-size: 40px; }
  .gate-brand h1 { font-size: 22px; max-width: 280px; }
  .gate-legacy { margin: 6px 0 0; max-width: 240px; }
  .gate-features { margin-top: auto; padding: 10px 16px 14px; }
  .gate-admin .gate-stage, .gate-admin .gate-features { order: 0; }
  .gate-stage { align-items: center; background: #F4EADF; padding: 12px; }
  .gate-card { padding: 16px 16px 14px; border-radius: 18px; }
  .gate-card h2 { font-size: 28px; }
  .gate-lede { margin-bottom: 10px; }
  .gate-field { margin-bottom: 8px; padding: 6px 10px; }
  .gate-submit { min-height: 40px; }
}

/* Tablet portrait */
@media (min-width: 700px) and (orientation: portrait) {
  .gate-scene { background-image: url("../images/login/tablet-portrait.jpg"); }
  .gate-brand { padding-top: 48px; }
  .gate-word { font-size: 72px; }
  .gate-brand h1 { font-size: 40px; }
  .gate-legacy { font-size: 16px; max-width: 420px; }
  .gate-stage { align-items: center; padding: 18px 28px; }
  .gate-card { padding: 32px 28px 26px; }
  .gate-admin .gate-features { order: 4; }
  .gate-admin .gate-stage { order: 2; }
  .gate-features {
    margin-top: auto;
    padding: 36px 28px 28px;
    background: linear-gradient(180deg, transparent, rgba(22, 14, 8, .9) 30%);
  }
  .gate-features em { display: block; margin-top: 4px; font-size: 12px; color: rgba(246, 235, 221, .78); }
  .gate-badge { width: 52px; height: 52px; }
}

/* Tablet landscape */
@media (min-width: 900px) and (max-width: 1279px) and (orientation: landscape) and (min-height: 541px) {
  .gate-scene {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #F7F1E8 url("../images/login/tablet-landscape.jpg") left center / 50% 100% no-repeat;
  }
  .gate-scene::before { width: 50%; background: linear-gradient(180deg, rgba(18,10,6,.55), rgba(18,10,6,.12) 36%, rgba(18,10,6,.78)); }
  .gate-side { display: flex; flex-direction: column; min-height: 100dvh; }
  .gate-brand { text-align: left; padding: 42px 40px 0; }
  .gate-mark { margin: 0 0 8px; }
  .gate-word { font-size: 64px; }
  .gate-brand h1 { font-size: 36px; max-width: 420px; }
  .gate-legacy { margin-left: 0; font-size: 15px; }
  .gate-features { margin-top: auto; padding: 20px 28px 32px; text-align: center; }
  .gate-features em { display: none; }
  .gate-admin .gate-stage, .gate-admin .gate-features { order: 0; }
  .gate-stage { align-items: center; background: #F7F1E8; padding: 28px 22px; }
  .gate-card-brand { display: block; text-align: center; color: var(--brown); margin-bottom: 8px; }
  .gate-card-brand .gate-word { font-size: 48px; }
  .gate-card-brand .gate-est { color: var(--muted); }
  .gate-card { width: min(460px, 100%); }
}

/* Desktop and laptop */
@media (min-width: 1280px) {
  .gate-scene {
    display: grid;
    grid-template-columns: 380px 1fr;
    background: var(--chocolate);
  }
  .gate-scene::before { display: none; }
  .gate-side {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--chocolate);
    color: var(--cream);
    padding: 36px 34px 28px;
  }
  .gate-brand { text-align: left; color: var(--cream); padding: 0; text-shadow: none; }
  .gate-mark { margin: 0 0 8px; }
  .gate-word { font-size: 68px; }
  .gate-brand h1 { font-size: 34px; max-width: 300px; margin-top: 28px; }
  .gate-legacy { margin: 10px 0 0; max-width: 280px; text-align: left; color: rgba(246,235,221,.8); }
  .gate-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    padding: 0;
    text-align: left;
    background: none;
  }
  .gate-features li { display: flex; gap: 12px; align-items: flex-start; }
  .gate-badge { margin: 0; flex: none; background: transparent; color: var(--gold); }
  .gate-features strong { font-size: 14px; }
  .gate-features em { display: block; margin-top: 2px; font-size: 12px; color: rgba(246,235,221,.68); }
  .gate-foot {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: auto;
    padding-top: 24px;
    color: var(--cream);
  }
  .gate-foot em { display: block; font-size: 12px; color: rgba(246,235,221,.68); }
  .gate-stage, .gate-features, .gate-foot { order: 0; }
  .gate-stage {
    align-items: center;
    background: #c4b39a url("../images/login/desktop.jpg") center / cover no-repeat;
    padding: 36px 28px;
  }
  .gate-script {
    display: block;
    position: absolute;
    top: 36px;
    right: 48px;
    margin: 0;
    font-family: var(--script);
    font-size: 46px;
    line-height: .95;
    text-align: right;
    color: var(--brown);
    z-index: 2;
  }
  .gate-card { width: min(460px, 100%); padding: 32px 28px 26px; }
  .gate-card-brand { display: none; }
}

@media (min-width: 1600px) {
  .gate-stage { background-image: url("../images/login/desktop-wide.jpg"); }
  .gate-script { font-size: 54px; right: 64px; }
}
