:root {
  --bg: #f4f6ff;
  --bg-soft: #eef2ff;
  --panel: #ffffff;
  --line: #dce3ff;
  --line-strong: #c8d3ff;
  --text: #13182f;
  --heading-text: #13182f;
  --muted: #667091;
  --accent: #4d5bff;
  --accent-2: #6f78ff;
  --field-surface: #ffffff;
  --field-border: #c6d2fb;
  --field-border-hover: #afc0f8;
  --field-text: #1d2650;
  --field-placeholder: #8c98bc;
  --field-focus: #4d5bff;
  --shadow: 0 14px 30px rgba(46, 65, 165, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: Inter, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 80%);
}

h1,
h2,
h3,
h4 {
  color: var(--heading-text);
}

.hidden {
  display: none !important;
}

html[data-app-loading-full="true"] #app-shell {
  visibility: hidden !important;
}

.app-auth-page {
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  background:
    radial-gradient(1200px 360px at 50% -20%, rgba(84, 104, 238, 0.2), transparent 58%),
    linear-gradient(180deg, #f8faff 0%, #edf2ff 100%);
}

.app-auth-page .auth-shell-signin {
  max-width: none;
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

html[data-app-auth-boot="session"] #auth-shell,
html[data-app-auth-boot="session"] .app-auth-page .auth-shell-signin,
html[data-app-auth-boot="session"] .auth-portal-bg {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.app-auth-page .app-shell {
  position: relative;
  z-index: 2;
}

.auth-portal-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-portal-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(86px);
  opacity: 0.3;
}

.auth-portal-glow-a {
  width: 430px;
  height: 430px;
  top: -210px;
  right: 8%;
  background: rgba(84, 115, 255, 0.48);
}

.auth-portal-glow-b {
  width: 380px;
  height: 380px;
  bottom: -190px;
  left: 5%;
  background: rgba(85, 202, 235, 0.38);
}

.auth-portal-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1180px, 92vw);
  height: min(76vh, 680px);
  border-radius: 28px;
  border: 1px solid rgba(159, 179, 255, 0.58);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.55) 0%, rgba(232, 240, 255, 0.4) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 30px 64px rgba(43, 62, 147, 0.12);
}

.auth-portal-topbar,
.auth-portal-sidebar,
.auth-portal-panel {
  position: absolute;
  border: 1px solid rgba(145, 168, 246, 0.46);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.56) 0%, rgba(227, 236, 255, 0.42) 100%);
}

.auth-portal-topbar {
  top: 18px;
  left: 18px;
  right: 18px;
  height: 54px;
}

.auth-portal-sidebar {
  top: 84px;
  left: 18px;
  width: 188px;
  bottom: 18px;
}

.auth-portal-panel-a {
  top: 84px;
  left: 220px;
  right: 18px;
  height: 180px;
}

.auth-portal-panel-b {
  top: 278px;
  left: 220px;
  width: 42%;
  bottom: 18px;
}

.auth-portal-panel-c {
  top: 278px;
  right: 18px;
  width: 30%;
  bottom: 18px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-signin-card {
  width: min(430px, 100%);
  border-radius: 20px;
  border-color: #d0dcff;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(9px);
  box-shadow: 0 24px 52px rgba(41, 62, 150, 0.16);
  padding: 30px;
  animation: auth-card-rise 220ms ease-out;
}

.auth-signin-card h1,
.auth-signin-card h2 {
  margin: 0 0 10px;
  line-height: 1.06;
  letter-spacing: 0;
}

.auth-signin-card h1 {
  font-size: clamp(34px, 4vw, 44px);
}

.auth-signin-card h2 {
  font-size: clamp(30px, 3.8vw, 38px);
}

.auth-signin-copy {
  margin: 0 0 14px;
  color: #58699a;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e2e9ff;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-auth-page .auth-signin-card .eyebrow {
  margin-bottom: 14px;
  padding: 7px 12px;
  background: #e6edff;
  color: #4057cb;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #62709a;
  margin-bottom: 9px;
}

.app-auth-page .auth-signin-card label {
  margin-bottom: 11px;
  color: #4e5f91;
  font-size: 13px;
}

.auth-password-help-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.auth-link-btn {
  border: 0;
  background: transparent;
  color: #4057cb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  padding: 0;
  text-align: right;
}

.auth-link-btn:hover {
  color: #2f42ad;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link-btn:focus-visible {
  border-radius: 6px;
  outline: 3px solid rgba(77, 91, 255, 0.18);
  outline-offset: 4px;
}

.auth-link-btn:disabled {
  color: #8b97bd;
  cursor: not-allowed;
  text-decoration: none;
}

.auth-inline-message {
  margin: -2px 0 12px;
  color: #58699a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
}

.auth-inline-message.error {
  color: #be3655;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-surface);
  color: var(--field-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 1px 2px rgba(24, 39, 87, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.app-auth-page .auth-signin-card input {
  margin-top: 6px;
  padding: 12px 13px;
  border-radius: 12px;
  border-color: #c8d4fb;
  background: rgba(245, 248, 255, 0.9);
}

input::placeholder {
  color: var(--field-placeholder);
  font-weight: 500;
  opacity: 1;
}

input:hover {
  border-color: var(--field-border-hover);
}

input:focus {
  border-color: var(--field-focus);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 0 0 3px rgba(77, 91, 255, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:hover {
  opacity: 0.95;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.app-auth-page .auth-signin-card .btn {
  width: 100%;
  margin-top: 4px;
  min-height: 48px;
}

.app-auth-page .auth-signin-card .auth-demo-btn {
  margin-top: 10px;
  border-color: #c8d4fb;
  background: #ffffff;
  color: #4057cb;
  box-shadow: none;
}

.auth-demo-note {
  margin: 10px 0 0;
  color: #58699a;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 12px;
  background: #17203f;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.24);
  padding: 12px 14px;
  font-weight: 700;
}

body.has-live-chat-widget .toast {
  bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

body.has-live-chat-widget.is-bottom-pagination-visible .toast {
  bottom: calc(192px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 640px) {
  .toast {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
  }

  body.has-live-chat-widget .toast {
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  body.has-live-chat-widget.is-bottom-pagination-visible .toast {
    bottom: calc(172px + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes auth-card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .app-auth-page .auth-shell-signin {
    padding: 16px;
  }

  .auth-signin-card {
    border-radius: 16px;
    padding: 24px 20px;
    background: #ffffff;
  }

  .auth-signin-card h1 {
    font-size: clamp(31px, 11vw, 40px);
  }

  .auth-signin-card h2 {
    font-size: clamp(28px, 10vw, 36px);
  }

  .auth-portal-frame {
    width: min(96vw, 520px);
    height: min(62vh, 410px);
    border-radius: 20px;
  }

  .auth-portal-sidebar,
  .auth-portal-panel-c {
    display: none;
  }

  .auth-portal-topbar {
    left: 16px;
    right: 16px;
    top: 16px;
    height: 50px;
  }

  .auth-portal-panel-a,
  .auth-portal-panel-b {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .auth-portal-panel-a {
    top: 78px;
    height: 96px;
  }

  .auth-portal-panel-b {
    top: 184px;
    bottom: 16px;
  }
}
