:root {
  color: #17233f;
  background: #f3f6fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.auth-page {
  background:
    radial-gradient(circle at 15% 15%, rgba(86, 104, 255, 0.14), transparent 34%),
    radial-gradient(circle at 85% 78%, rgba(21, 184, 166, 0.12), transparent 34%),
    #f5f7fb;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px 20px;
}

.auth-card {
  width: min(100%, 470px);
  padding: 42px;
  border: 1px solid #dfe5f1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(31, 45, 78, 0.14);
}

.auth-card.wide {
  width: min(100%, 520px);
}

.auth-brand,
.brand-mark {
  display: grid;
  color: #fff;
  background: linear-gradient(145deg, #4f63ef, #3548cd);
  place-items: center;
  box-shadow: 0 10px 24px rgba(70, 88, 226, 0.26);
}

.auth-brand {
  width: 52px;
  height: 52px;
  margin-bottom: 26px;
  border-radius: 16px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 8px;
  color: #657493;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.auth-card h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.2;
}

.auth-description {
  margin-bottom: 26px;
  color: #687590;
  font-size: 14px;
  line-height: 1.7;
}

.notice {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.notice.error {
  color: #a22a3a;
  border: 1px solid #f3c6ce;
  background: #fff1f3;
}

.notice.success {
  color: #176a55;
  border: 1px solid #b9e6d9;
  background: #ecfbf6;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form label span {
  color: #35415c;
  font-size: 14px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #d6ddeb;
  border-radius: 12px;
  outline: none;
  color: #17233f;
  background: #fbfcfe;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.auth-form input:focus {
  border-color: #5368ec;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(83, 104, 236, 0.12);
}

.primary-button {
  display: grid;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #5569f0, #3e50d8);
  box-shadow: 0 12px 24px rgba(65, 82, 215, 0.24);
  cursor: pointer;
  font-weight: 800;
  place-items: center;
}

.primary-button:hover {
  filter: brightness(1.04);
}

.auth-footnote,
.password-hint {
  color: #8893aa;
  font-size: 12px;
  line-height: 1.6;
}

.auth-footnote {
  margin: 24px 0 0;
  text-align: center;
}

.password-hint {
  margin: -6px 0 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: #5266e9;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.error-card {
  text-align: center;
}

.error-code {
  margin-bottom: 12px;
  color: #5266e9;
  font-size: 58px;
  font-weight: 900;
}

.button-link {
  margin-top: 26px;
  text-decoration: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  overflow-y: auto;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid #e1e6ef;
  background: #0f1930;
  color: #fff;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 900;
  flex: 0 0 auto;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 15px;
}

.sidebar-brand small {
  margin-top: 4px;
  color: #8f9bb5;
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-group {
  margin: 20px 10px 7px;
  color: #77839d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #cbd3e5;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(93, 113, 239, 0.17);
}

.nav-icon {
  display: grid;
  min-width: 38px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 10px;
  place-items: center;
}

.sidebar-security {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #35d29b;
  box-shadow: 0 0 0 5px rgba(53, 210, 155, 0.1);
  flex: 0 0 auto;
}

.sidebar-security strong,
.sidebar-security small {
  display: block;
}

.sidebar-security strong {
  font-size: 12px;
}

.sidebar-security small {
  margin-top: 3px;
  color: #8895af;
  font-size: 10px;
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 16px;
  padding: 14px 34px;
  border-bottom: 1px solid #e1e6ef;
  background: rgba(250, 251, 253, 0.92);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
}

.topbar .eyebrow {
  margin-bottom: 3px;
}

.menu-button {
  display: none;
  height: 38px;
  padding: 0 13px;
  border: 1px solid #d8deea;
  border-radius: 10px;
  background: #fff;
  color: #25314d;
  cursor: pointer;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.account-actions form {
  margin: 0;
}

.account-name {
  margin-right: 4px;
  color: #586681;
  font-size: 13px;
  font-weight: 700;
}

.text-button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d7deeb;
  border-radius: 10px;
  background: #fff;
  color: #35415b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.content {
  width: min(100%, 1260px);
  margin: 0 auto;
  padding: 34px;
}

.summary-card {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px;
  border: 1px solid #dfe5f0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 84% 0%, rgba(77, 104, 238, 0.14), transparent 32%),
    linear-gradient(135deg, #fff, #f7f9ff);
  box-shadow: 0 14px 38px rgba(31, 45, 78, 0.07);
}

.summary-card h2 {
  margin-bottom: 10px;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.2;
}

.summary-card p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 0;
  color: #66738e;
  line-height: 1.7;
}

.summary-stat {
  display: grid;
  min-width: 142px;
  min-height: 112px;
  border: 1px solid #dbe1f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  place-content: center;
  text-align: center;
}

.summary-stat strong {
  color: #4359df;
  font-size: 38px;
  line-height: 1;
}

.summary-stat span {
  margin-top: 7px;
  color: #73809a;
  font-size: 12px;
  font-weight: 700;
}

.service-section {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-heading > span {
  color: #8a95aa;
  font-size: 12px;
}

.service-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  position: relative;
  display: grid;
  min-height: 228px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid #dfe5ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 45, 78, 0.055);
  grid-template-rows: auto 1fr auto;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(31, 45, 78, 0.09);
}

.service-card::after {
  position: absolute;
  top: -52px;
  right: -52px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-soft, #eef2ff);
  content: "";
}

.service-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 14px;
  color: var(--accent, #4d63ea);
  background: var(--accent-soft, #eef2ff);
  font-size: 11px;
  font-weight: 900;
  place-items: center;
}

.service-copy h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.service-copy p {
  margin-bottom: 20px;
  color: #748099;
  font-size: 13px;
  line-height: 1.65;
}

.service-link {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  color: var(--accent, #4d63ea);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.accent-blue {
  --accent: #3a67e7;
  --accent-soft: #edf3ff;
}

.accent-violet {
  --accent: #7255d9;
  --accent-soft: #f2efff;
}

.accent-cyan {
  --accent: #1389a5;
  --accent-soft: #eaf9fc;
}

.accent-green {
  --accent: #17865f;
  --accent-soft: #eaf8f2;
}

.accent-orange {
  --accent: #b46716;
  --accent-soft: #fff4e7;
}

.accent-slate {
  --accent: #4e607c;
  --accent-soft: #eff3f7;
}

.migration-note {
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid #dce4f0;
  border-radius: 15px;
  background: #fff;
}

.migration-note strong {
  font-size: 13px;
}

.migration-note p {
  margin: 6px 0 0;
  color: #748099;
  font-size: 12px;
  line-height: 1.7;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1040px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(86vw, 300px);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 15;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(10, 17, 34, 0.48);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
  }

  .topbar {
    min-height: 72px;
    padding: 10px 16px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .account-name,
  .account-actions .text-button:first-of-type {
    display: none;
  }

  .text-button {
    padding: 0 10px;
  }

  .content {
    padding: 20px 15px 32px;
  }

  .summary-card {
    display: grid;
    min-height: auto;
    padding: 24px;
  }

  .summary-stat {
    min-height: 90px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 210px;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    padding: 18px 12px;
  }

  .auth-card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .auth-card h1 {
    font-size: 26px;
  }
}
