/* Royal Smoke — auth / cabinet gate (full viewport under header) */
/* Header & footer: never override — same site chrome everywhere */

body.rs-auth-page {
  --rs-gate-bg: #100d0c;
  --rs-gate-glass: rgba(12, 10, 9, 0.82);
  background: var(--rs-gate-bg);
}

body.rs-auth-page .rs-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--rs-header-h) - var(--rs-safe-t, 0px) - 1px);
  min-height: calc(100svh - var(--rs-header-h) - var(--rs-safe-t, 0px) - 1px);
  padding-bottom: 0;
  background: var(--rs-gate-bg);
}

/* Short auth — slightly taller than viewport; footer after small scroll */
body.rs-auth-page:not(.rs-cab-page) {
  --rs-auth-scroll-room: 100px;
}

body.rs-auth-page:not(.rs-cab-page) .rs-main {
  min-height: calc(
    100dvh - var(--rs-header-h) - var(--rs-safe-t, 0px) + var(--rs-auth-scroll-room)
  );
  min-height: calc(
    100svh - var(--rs-header-h) - var(--rs-safe-t, 0px) + var(--rs-auth-scroll-room)
  );
}

body.rs-auth-page:not(.rs-cab-page) .rs-gate {
  flex: 1 1 auto;
  min-height: 100%;
}

body.rs-auth-page:not(.rs-cab-page) .rs-gate__main {
  flex: 1 1 auto;
  justify-content: flex-start;
}

body.rs-auth-page .rs-flash {
  margin: 0;
}

.rs-gate {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  background: var(--rs-gate-bg);
  color: var(--rs-seashell);
}

.rs-gate__main,
.rs-gate__aside {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding:
    clamp(32px, 6vw, 72px)
    clamp(20px, 5vw, 80px)
    calc(clamp(32px, 6vw, 72px) + var(--rs-safe-b, 0px));
}

.rs-gate__main {
  position: relative;
  z-index: 1;
  align-items: center;
  background: var(--rs-gate-bg);
}

.rs-gate__aside {
  position: relative;
  z-index: 1;
  --rs-gate-aside-pad: clamp(20px, 5vw, 80px);
  background: var(--rs-gate-bg);
  border: 0;
  box-shadow: none;
  justify-content: flex-start;
  align-items: stretch;
  padding-block: clamp(20px, 3vw, 36px);
  padding-inline: var(--rs-gate-aside-pad);
}

.rs-gate__card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  min-height: min(420px, 58vh);
  margin-inline: auto;
  padding: 28px 22px 22px;
  border-radius: 20px;
  border: 1px solid rgba(252, 242, 238, 0.14);
  background: rgba(252, 242, 238, 0.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(252, 242, 238, 0.08);
}

.rs-gate__card::before {
  content: "";
  position: absolute;
  top: -7px;
  /* Центр під іконку кабінету (лівіше кошика) */
  right: calc(var(--rs-pad-x) + var(--rs-tap) * 1.5 + 12px - var(--rs-gate-aside-pad) - 7px);
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(16, 13, 12, 0.92);
  border-top: 1px solid rgba(252, 242, 238, 0.14);
  border-left: 1px solid rgba(252, 242, 238, 0.14);
  transform: rotate(45deg);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rs-gate__card {
    background: rgba(28, 23, 21, 0.55);
  }
}

.rs-gate__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  text-align: center;
}

.rs-gate__title {
  align-self: center;
  margin: 0 0 12px;
  text-align: center;
}

.rs-gate__lead {
  margin: 0 0 36px;
  font-family: var(--rs-font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--rs-text-muted);
  text-align: center;
}

.rs-gate .rs-form {
  max-width: none;
  gap: 14px;
  text-align: start;
}

.rs-gate .rs-field {
  gap: 0;
}

.rs-gate .rs-field input,
.rs-gate .rs-field select,
.rs-gate .rs-field textarea {
  min-height: 52px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(252, 242, 238, 0.22);
  border-radius: 0;
  color: var(--rs-seashell);
  font-family: var(--rs-font-ui);
  font-size: 16px;
  font-weight: var(--rs-weight-ui);
  letter-spacing: 0.04em;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

.rs-gate .rs-field input::placeholder {
  color: rgba(252, 242, 238, 0.42);
  opacity: 1;
  letter-spacing: 0.04em;
}

.rs-gate .rs-field input:focus,
.rs-gate .rs-field select:focus,
.rs-gate .rs-field textarea:focus {
  outline: none;
  border-color: var(--rs-gold);
}

.rs-gate .rs-field input:-webkit-autofill,
.rs-gate .rs-field input:-webkit-autofill:hover,
.rs-gate .rs-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--rs-seashell);
  caret-color: var(--rs-seashell);
  box-shadow: 0 0 0 1000px #100d0c inset;
  -webkit-box-shadow: 0 0 0 1000px #100d0c inset;
  transition: background-color 99999s ease-out;
}

.rs-gate .rs-form__actions {
  margin-top: 6px;
}

.rs-gate .rs-btn--gold {
  min-height: 52px;
  border-radius: 0;
  font-family: var(--rs-font-ui);
  font-weight: var(--rs-weight-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rs-gate .rs-auth__switch {
  margin-top: 22px;
  font-family: var(--rs-font-ui);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--rs-text-muted);
}

.rs-gate .rs-auth__switch a {
  color: var(--rs-gold);
  border-bottom: 1px solid var(--rs-gold);
  text-decoration: none;
}

.rs-gate .rs-auth__switch a:hover {
  color: var(--rs-gold-hover);
  border-bottom-color: var(--rs-gold-hover);
}

.rs-gate .rs-check {
  margin-top: 4px;
}

.rs-gate__eyebrow {
  margin: 0 0 18px;
  padding-inline: 4px;
  font-family: var(--rs-font-ui);
  font-size: 11px;
  font-weight: var(--rs-weight-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rs-text-muted);
}

.rs-gate__menu {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
}

.rs-gate__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 60px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(252, 242, 238, 0.12);
  background: rgba(252, 242, 238, 0.07);
  color: rgba(252, 242, 238, 0.94);
  font-family: var(--rs-font-ui);
  font-size: 14px;
  font-weight: var(--rs-weight-sub);
  letter-spacing: 0.12em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background var(--rs-dur-fast) var(--rs-ease),
    border-color var(--rs-dur-fast) var(--rs-ease),
    color var(--rs-dur-fast) var(--rs-ease);
  -webkit-tap-highlight-color: transparent;
}

.rs-gate__menu-btn:hover {
  background: rgba(252, 242, 238, 0.1);
  border-color: rgba(201, 154, 68, 0.35);
  color: var(--rs-seashell);
}

.rs-gate__menu-btn:active {
  background: rgba(252, 242, 238, 0.08);
}

/* Authenticated cabinet panels inside main column */
.rs-gate__panels {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.rs-gate__panel {
  padding: 22px 0;
  border-bottom: 1px solid var(--rs-hairline);
}

.rs-gate__panel:first-child {
  padding-top: 0;
}

.rs-gate__panel:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rs-gate__panel-title {
  margin: 0 0 8px;
  font-family: var(--rs-font-ui);
  font-weight: var(--rs-weight-sub);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.12;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-transform: uppercase;
  color: rgba(252, 242, 238, 0.92);
}

.rs-gate__panel p,
.rs-gate__panel li {
  margin: 0;
  font-family: var(--rs-font-ui);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--rs-text-muted);
}

.rs-gate__panel-meta {
  margin-top: 6px;
}

.rs-gate__panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-gate__panel + .rs-gate__panel {
  margin-top: 0;
}

.rs-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 10px;
}

.rs-gate__actions a {
  color: var(--rs-gold);
  border-bottom: 1px solid var(--rs-gold);
  text-decoration: none;
  font-family: var(--rs-font-ui);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.rs-gate__actions a:hover {
  color: var(--rs-gold-hover);
  border-bottom-color: var(--rs-gold-hover);
}

.rs-gate__logout {
  display: inline;
  margin: 0;
  padding: 0;
}

.rs-gate__logout button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--rs-gold);
  background: transparent;
  color: var(--rs-gold);
  font: inherit;
  font-family: var(--rs-font-ui);
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.rs-gate__logout button:hover {
  color: var(--rs-gold-hover);
  border-bottom-color: var(--rs-gold-hover);
}

@supports (-webkit-touch-callout: none) {
  body.rs-auth-page.rs-cab-page .rs-main {
    min-height: -webkit-fill-available;
  }

  body.rs-auth-page:not(.rs-cab-page) .rs-main {
    min-height: calc(
      100dvh - var(--rs-header-h) - var(--rs-safe-t, 0px) + var(--rs-auth-scroll-room)
    );
    min-height: calc(
      100svh - var(--rs-header-h) - var(--rs-safe-t, 0px) + var(--rs-auth-scroll-room)
    );
  }

  .rs-gate .rs-field input,
  .rs-gate .rs-field select,
  .rs-gate .rs-field textarea {
    font-size: 16px;
  }
}

@media (min-width: 768px) {
  .rs-gate__main {
    min-height: 100%;
    padding-block:
      clamp(40px, 6vh, 80px)
      calc(clamp(40px, 6vh, 80px) + var(--rs-safe-b, 0px));
    padding-inline: clamp(32px, 6vw, 80px);
  }

  body.rs-auth-page:not(.rs-cab-page) .rs-gate__main {
    justify-content: flex-start;
    padding-block:
      clamp(28px, 4vh, 56px)
      calc(clamp(28px, 4vh, 48px) + var(--rs-safe-b, 0px));
  }
}

@media (min-width: 1024px) {
  .rs-gate__main {
    padding-inline: clamp(48px, 8vw, 120px);
  }

  .rs-gate__inner {
    max-width: 460px;
  }
}

@media (max-width: 767px) {
  body.rs-auth-page:not(.rs-cab-page) {
    --rs-auth-scroll-room: 80px;
  }

  body.rs-auth-page.rs-cab-page .rs-main {
    min-height: 0;
  }

  body.rs-auth-page.rs-cab-page .rs-gate {
    flex: 0 0 auto;
    min-height: 0;
  }

  .rs-gate__main {
    justify-content: flex-start;
    padding-top: clamp(16px, 4vw, 28px);
    padding-bottom: calc(clamp(20px, 4vw, 32px) + var(--rs-safe-b, 0px));
  }

  .rs-gate__aside {
    justify-content: flex-start;
    align-items: center;
  }

  .rs-gate__card::before {
    display: none;
  }

  .rs-gate__lead {
    margin-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rs-gate .rs-field input,
  .rs-gate .rs-btn--gold,
  .rs-gate .rs-auth__switch a,
  .rs-gate__actions a,
  .rs-gate__menu-btn {
    transition: none;
  }
}
