:root {
  --grm-bg-top: #eef5ff;
  --grm-bg-bottom: #dceafe;
  --grm-surface: #ffffff;
  --grm-surface-soft: #f4f8ff;
  --grm-border: #d7e5fa;
  --grm-text: #22324f;
  --grm-muted: #5d7295;
  --grm-accent: #4b79d8;
  --grm-accent-strong: #305aac;
  --grm-success-bg: #eaf8ef;
  --grm-success-border: #b8e4c8;
  --grm-success-text: #1f6e3a;
  --grm-danger-bg: #fff0f2;
  --grm-danger-border: #f2c4cb;
  --grm-danger-text: #a83247;
  --grm-warning-bg: #fff9eb;
  --grm-warning-border: #f5deb1;
  --grm-warning-text: #9a6a0a;
  --grm-shadow: 0 16px 42px rgba(39, 79, 143, 0.14);
  --grm-shadow-soft: 0 8px 24px rgba(46, 84, 145, 0.12);
  --wrap: min(1180px, calc(100vw - 36px));
}

* {
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  color: var(--grm-text);
  font-family: "Manrope", "Segoe UI", "Roboto", sans-serif;
  background:
    radial-gradient(circle at 10% 14%, rgba(255, 255, 255, 0.92), transparent 34%),
    radial-gradient(circle at 87% 18%, rgba(123, 169, 244, 0.22), transparent 30%),
    linear-gradient(165deg, var(--grm-bg-top), var(--grm-bg-bottom));
  min-height: 100vh;
}

:where(body.auth-page a) {
  text-decoration: none;
}

.shell {
  width: var(--wrap);
  margin: 0 auto;
}

.header-wrap {
  position: sticky;
  top: 14px;
  z-index: 80;
  padding-top: 14px;
  transition: top 0.24s ease, padding-top 0.24s ease;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 10px 18px;
  border: 1px solid var(--grm-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--grm-shadow-soft);
  backdrop-filter: blur(8px);
  transition: background-color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, border-radius 0.24s ease, padding 0.24s ease;
}

@media (min-width: 761px) {
  .header-wrap::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform: none;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(215, 229, 250, 0.82);
    box-shadow: 0 10px 26px rgba(46, 84, 145, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: -1;
  }

  .header-wrap.is-stuck {
    top: 0;
    padding-top: 0;
  }

  .header-wrap.is-stuck::before {
    opacity: 1;
  }

  .header-wrap.is-stuck .header {
    min-height: 60px;
    padding: 8px 0;
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
}

.header > nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 800;
  color: #2a4f8a;
  letter-spacing: 0.01em;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.brand-mark {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 1.07rem;
  line-height: 1.05;
}

.brand-mark small {
  display: block;
  margin-top: 2px;
  font-family: "Manrope", sans-serif;
  font-size: 0.68rem;
  color: #6c82a6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  flex: 0 0 auto;
}

.nav a {
  padding: 10px 13px;
  border-radius: 12px;
  font-weight: 700;
  color: #385883;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav a:hover {
  background: #e8f1ff;
  color: #274b83;
  transform: translateY(-1px);
}

.nav a[aria-current="page"] {
  background: #e8f1ff;
  color: #274b83;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  border-radius: 12px;
  border: 1px solid #c6d9f7;
  background: #f7fbff;
  color: #355886;
  font-weight: 700;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #edf5ff;
  box-shadow: 0 10px 18px rgba(53, 89, 150, 0.12);
}

.btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(140deg, var(--grm-accent), var(--grm-accent-strong));
  box-shadow: 0 10px 24px rgba(52, 93, 171, 0.26);
}

.btn.primary:hover {
  background: linear-gradient(140deg, #5888ea, #2d58af);
}

.auth-main {
  width: var(--wrap);
  margin: 28px auto 0;
  padding-bottom: 24px;
}

.auth-layout {
  border: 1px solid var(--grm-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.87);
  box-shadow: var(--grm-shadow);
  display: grid;
  grid-template-columns: 1fr minmax(330px, 460px);
  gap: 22px;
  padding: 24px;
}

.auth-side {
  border-radius: 18px;
  border: 1px solid #dce8fb;
  background: linear-gradient(180deg, #f9fcff, #f1f7ff);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
}

.auth-side::before {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(82, 126, 214, 0.26), rgba(82, 126, 214, 0));
  pointer-events: none;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #d4e4fb;
  background: #f3f8ff;
  color: #4a6794;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.auth-title {
  margin: 14px 0 10px;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 16ch;
  position: relative;
  z-index: 1;
}

.auth-lead {
  margin: 0;
  color: var(--grm-muted);
  line-height: 1.62;
  max-width: 54ch;
  position: relative;
  z-index: 1;
}

.bullet-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d8e8fd;
  color: #335581;
  font-weight: 600;
  line-height: 1.4;
}

.bullet-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 0.35em;
  background: linear-gradient(140deg, #4f80df, #315cad);
  flex: 0 0 auto;
}

.panel {
  border-radius: 18px;
  border: 1px solid #d8e7fc;
  background: #ffffff;
  padding: 22px;
  box-shadow: 0 12px 24px rgba(50, 84, 143, 0.08);
}

.panel-title {
  margin: 0;
  font-size: 1.3rem;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 8px 0 16px;
  color: var(--grm-muted);
  line-height: 1.52;
  font-size: 0.95rem;
}

.panel-head {
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.panel-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #d2e2fb;
  background: #eef5ff;
  color: #2f568f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.panel-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4f80df;
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 600;
}

.alert.success {
  color: var(--grm-success-text);
  border-color: var(--grm-success-border);
  background: var(--grm-success-bg);
}

.alert.danger {
  color: var(--grm-danger-text);
  border-color: var(--grm-danger-border);
  background: var(--grm-danger-bg);
}

.alert.warning {
  color: var(--grm-warning-text);
  border-color: var(--grm-warning-border);
  background: var(--grm-warning-bg);
}

.alert-list {
  margin: 0 0 16px;
  padding: 12px 14px 12px 30px;
  border-radius: 12px;
  border: 1px solid var(--grm-danger-border);
  background: var(--grm-danger-bg);
  color: var(--grm-danger-text);
  line-height: 1.5;
  font-weight: 600;
}

.alert-list li + li {
  margin-top: 4px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-weight: 700;
  color: #2d4c79;
  font-size: 0.9rem;
}

input[type="email"],
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c8dbf9;
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  color: #1f3558;
  background: #fafdff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input::placeholder {
  color: #8ca2c3;
}

input:focus {
  outline: none;
  border-color: #6a95e8;
  box-shadow: 0 0 0 3px rgba(106, 149, 232, 0.2);
  background: #ffffff;
}

.field-hint {
  margin: 2px 0 0;
  color: #6d85a8;
  font-size: 0.82rem;
  line-height: 1.4;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.actions .btn,
.actions button {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #c8dbf9;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.actions-inline .btn {
  width: auto;
}

.actions button {
  border: 0;
  color: #fff;
  background: linear-gradient(140deg, var(--grm-accent), var(--grm-accent-strong));
  box-shadow: 0 10px 24px rgba(52, 93, 171, 0.24);
}

.actions button:hover {
  background: linear-gradient(140deg, #5888ea, #2d58af);
  transform: translateY(-1px);
}

.text-links {
  margin-top: 12px;
  color: #5c7295;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.45;
}

.text-links a {
  color: #355c9a;
  font-weight: 700;
}

.text-links a:hover {
  text-decoration: underline;
}

.shell-single {
  max-width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.status-panel {
  padding: 24px;
}

.status-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: center;
  border-radius: 26px;
  padding: 34px 34px 32px;
  background:
    radial-gradient(circle at 10% 16%, rgba(255, 255, 255, 0.96), transparent 32%),
    radial-gradient(circle at 90% 12%, rgba(88, 136, 234, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.9));
}

.status-hero::before {
  content: "";
  position: absolute;
  inset: auto -90px -110px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(83, 128, 214, 0.16), rgba(83, 128, 214, 0));
  filter: blur(6px);
  pointer-events: none;
}

.status-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.status-hero-title {
  margin: 16px 0 12px;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 12ch;
}

.status-hero-sub {
  max-width: 52ch;
  margin-bottom: 24px;
  font-size: 1.03rem;
}

.status-hero .alert {
  margin-bottom: 22px;
  max-width: 560px;
}

.status-hero .actions-inline {
  gap: 12px;
}

.status-visual {
  --status-accent: #4b79d8;
  --status-accent-strong: #315cac;
  --status-soft: rgba(75, 121, 216, 0.14);
  --status-soft-strong: rgba(49, 92, 172, 0.24);
  --status-pill-bg: #eff5ff;
  --status-pill-border: #d3e2fb;
  --status-pill-text: #486894;
  --status-state-start: #5d8cec;
  --status-state-end: #3f6cc2;
  position: relative;
  min-height: 340px;
}

.status-visual--success {
  --status-accent: #4b79d8;
  --status-accent-strong: #315cac;
  --status-soft: rgba(75, 121, 216, 0.16);
  --status-soft-strong: rgba(70, 193, 145, 0.18);
  --status-pill-bg: #f0f7ff;
  --status-pill-border: #d3e4fb;
  --status-pill-text: #476691;
  --status-state-start: #49c89c;
  --status-state-end: #329d73;
}

.status-visual--warning {
  --status-accent: #efb34d;
  --status-accent-strong: #d7901f;
  --status-soft: rgba(239, 179, 77, 0.18);
  --status-soft-strong: rgba(215, 144, 31, 0.22);
  --status-pill-bg: #fff7e8;
  --status-pill-border: #f7dfb1;
  --status-pill-text: #95640f;
  --status-state-start: #efb34d;
  --status-state-end: #d7901f;
}

.status-visual--danger {
  --status-accent: #de6e8c;
  --status-accent-strong: #bf4a68;
  --status-soft: rgba(222, 110, 140, 0.18);
  --status-soft-strong: rgba(191, 74, 104, 0.24);
  --status-pill-bg: #fff2f5;
  --status-pill-border: #f5ced7;
  --status-pill-text: #b04662;
  --status-state-start: #de6e8c;
  --status-state-end: #bf4a68;
}

.status-visual-glow {
  position: absolute;
  inset: 22px 8px auto auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--status-soft-strong), rgba(255, 255, 255, 0));
  filter: blur(12px);
  animation: grm-status-glow 7.4s ease-in-out infinite;
}

.status-floating-pill,
.status-toast {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px solid var(--status-pill-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 40px rgba(53, 89, 150, 0.12);
  color: var(--status-pill-text);
  font-weight: 700;
  line-height: 1.35;
  backdrop-filter: blur(10px);
}

.status-floating-pill {
  top: 8px;
  right: 8px;
  max-width: 250px;
  animation: grm-status-float 6.8s ease-in-out infinite;
}

.status-floating-pill-dot,
.status-toast-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.9), var(--status-accent));
  box-shadow: 0 0 0 6px var(--status-soft);
}

.status-visual-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 300px);
  border-radius: 28px;
  border: 1px solid #d6e5fb;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 26px 42px rgba(46, 84, 145, 0.16);
  backdrop-filter: blur(10px);
}

.status-visual-card--back {
  height: 260px;
  transform: translate(-34%, -48%) rotate(-8deg);
  padding: 26px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 248, 255, 0.86)),
    linear-gradient(135deg, var(--status-soft), rgba(255, 255, 255, 0));
  animation: grm-status-back-card 7.2s ease-in-out infinite;
}

.status-visual-card--front {
  min-height: 286px;
  transform: translate(-56%, -34%) rotate(7deg);
  padding: 24px 24px 22px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.96), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 255, 0.92));
  animation: grm-status-front-card 7.2s ease-in-out infinite;
}

.status-visual-lines {
  display: grid;
  gap: 22px;
  margin-top: 42px;
}

.status-visual-lines span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 131, 207, 0.16), rgba(91, 131, 207, 0.04));
}

.status-visual-lines span:nth-child(1) {
  width: 78%;
}

.status-visual-lines span:nth-child(2) {
  width: 62%;
}

.status-visual-lines span:nth-child(3) {
  width: 86%;
}

.status-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  max-width: 100%;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--status-pill-border);
  background: var(--status-pill-bg);
  color: var(--status-pill-text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
}

.status-card-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}

.status-icon-block {
  display: grid;
  place-items: center;
  height: 116px;
  border-radius: 28px;
  border: 1px solid #dce8fb;
  background: linear-gradient(180deg, #f8fbff, #e8f1ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--status-accent-strong);
}

.status-icon-block svg {
  width: 42px;
  height: 42px;
}

.status-icon-block--mail {
  transform: translateY(-10px);
}

.status-icon-block--state {
  background: linear-gradient(150deg, var(--status-state-start), var(--status-state-end));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 20px 28px var(--status-soft-strong);
}

.status-toast {
  right: 0;
  bottom: 18px;
  max-width: 252px;
  animation: grm-status-toast 7.2s ease-in-out infinite;
}

@keyframes grm-status-glow {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-8px, 10px, 0) scale(1.04);
  }
}

@keyframes grm-status-back-card {
  0%,
  100% {
    transform: translate(-34%, -48%) rotate(-8deg);
  }
  50% {
    transform: translate(-31%, -51%) rotate(-5deg);
  }
}

@keyframes grm-status-front-card {
  0%,
  100% {
    transform: translate(-56%, -34%) rotate(7deg);
  }
  50% {
    transform: translate(-58%, -30%) rotate(4deg);
  }
}

@keyframes grm-status-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-8px, -10px, 0);
  }
}

@keyframes grm-status-toast {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(10px, -8px, 0);
  }
}

.footer {
  width: var(--wrap);
  margin: 18px auto 30px;
  color: #5c7295;
  text-align: center;
  font-size: 0.9rem;
}

.footer a {
  color: #355c9a;
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 1020px) {
  .header {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav {
    flex-wrap: wrap;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .status-hero {
    grid-template-columns: 1fr;
  }

  .status-copy {
    max-width: none;
  }

  .status-visual {
    min-height: 300px;
    margin-top: 6px;
  }
}

@media (max-width: 1320px) {
  .header {
    gap: 12px;
    padding: 10px 14px;
  }

  .brand-mark small {
    display: none;
  }

  .nav {
    gap: 4px;
  }

  .nav a {
    padding: 9px 10px;
    font-size: 0.93rem;
  }

  .header-actions .btn {
    padding: 10px 13px;
  }
}

@media (max-width: 640px) {
  .header {
    border-radius: 16px;
    padding: 12px;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .nav {
    width: 100%;
    justify-content: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .auth-layout {
    border-radius: 18px;
    padding: 14px;
  }

  .status-hero {
    padding: 22px 18px 18px;
    border-radius: 20px;
    gap: 18px;
  }

  .status-hero-title {
    font-size: clamp(1.85rem, 10vw, 2.5rem);
    max-width: none;
  }

  .status-hero .alert {
    margin-bottom: 18px;
  }

  .status-visual {
    min-height: 250px;
  }

  .status-hero .status-visual {
    display: none;
  }

  .status-floating-pill,
  .status-toast {
    max-width: 220px;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
  }

  .status-visual-card--back {
    height: 210px;
  }

  .status-visual-card--front {
    min-height: 236px;
    padding: 20px 18px 18px;
  }

  .status-card-grid {
    margin-top: 22px;
    gap: 12px;
  }

  .status-icon-block {
    height: 92px;
    border-radius: 22px;
  }

  .status-icon-block svg {
    width: 34px;
    height: 34px;
  }

  .auth-side,
  .panel {
    padding: 16px;
  }

  .panel-head {
    flex-wrap: wrap;
  }

  .panel-badge {
    margin-left: 0;
  }

  .actions-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-inline .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-visual-glow,
  .status-floating-pill,
  .status-visual-card--back,
  .status-visual-card--front,
  .status-toast {
    animation: none !important;
  }
}
