:root {
  --bg-top: #f4f6fa;
  --bg-bottom: #edf1f6;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --ink: #23303a;
  --muted: #5d6b74;
  --accent: #526c7a;
  --accent-strong: #405866;
  --line: rgba(35, 48, 58, 0.12);
  --shadow: 0 14px 34px rgba(35, 48, 58, 0.08);
  --danger: #8c2f39;
  --info: #1b5f8b;
  --docs-header: #546d78;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.login-page .md-header,
.login-page .md-tabs,
.login-page .md-dialog,
.login-page .md-search {
  font-family: "Roboto", "Helvetica Neue", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.shell-narrow {
  width: min(620px, calc(100% - 2rem));
}

.login-shell {
  width: min(580px, calc(100% - 2rem));
  padding-top: 2.6rem;
  padding-bottom: 2.2rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo img {
  display: block;
  height: 72px;
  width: auto;
}

h1 {
  margin: 0;
  max-width: 11ch;
  font-family: Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.lead {
  max-width: 62ch;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.lead-compact {
  max-width: 48ch;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.topbar-tight {
  margin-bottom: 1rem;
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(35, 48, 58, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.lang-pill.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.login-page {
  background:
    linear-gradient(180deg, rgba(84, 109, 120, 0.12) 0%, rgba(84, 109, 120, 0) 280px),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.login-header {
  background: var(--docs-header);
  box-shadow: none;
}

.login-header__bar,
.login-tabs__inner {
  width: min(88rem, calc(100% - 2rem));
  margin: 0 auto;
}

.login-header__bar {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  min-height: 6.4rem;
  padding: 0.55rem 0 0.45rem;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.login-brand img {
  display: block;
  height: 82px;
  width: auto;
}

.login-header__title {
  color: #fff;
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}

.login-header__search {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 20.5rem;
  padding: 0.82rem 1rem;
  border-radius: 0.12rem;
  background: rgba(35, 48, 58, 0.18);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.98rem;
}

.login-header__search svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
  flex: 0 0 auto;
}

.login-tabs {
  padding-bottom: 0.85rem;
}

.login-tabs__inner {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}

.login-tabs__link {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.2;
}

.login-tabs__link:hover,
.login-tabs__link--active {
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2.2rem;
}

.grid-home {
  margin-top: 1.35rem;
}

.card,
.support-actions a,
.primary-button {
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.card {
  display: grid;
  gap: 0.8rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.card:hover,
.support-actions a:hover,
.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(35, 48, 58, 0.14);
}

.card-tag {
  display: inline-flex;
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(66, 93, 114, 0.1);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.card strong {
  font-size: 1.35rem;
}

.card span:last-child {
  color: var(--muted);
  line-height: 1.65;
}

.card-home {
  min-height: 240px;
  align-content: start;
}

.hero-panel,
.support,
.login-panel {
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.4rem;
  padding: 1.8rem;
}

.hero-copy {
  min-width: 0;
}

.hero-note {
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 0.2rem;
  padding: 1.1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(82, 108, 122, 0.12) 0%, rgba(82, 108, 122, 0.04) 100%);
}

.hero-note p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.hero-note-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(82, 108, 122, 0.12);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.support {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding: 1.35rem 1.45rem;
}

.support-home {
  margin-top: 1.25rem;
}

.support-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.support-copy {
  margin: 0.45rem 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.7;
}

.support-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.support-actions a,
.primary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font: inherit;
}

.login-panel {
  display: grid;
  gap: 1rem;
  padding: 1.55rem 1.8rem 1.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(35, 48, 58, 0.16);
}

.login-panel,
.login-copy,
.login-form,
.flash-stack {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.login-panel h1 {
  max-width: none;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: clamp(1.18rem, 1.45vw, 1.55rem);
  font-weight: 700;
  line-height: 1.24;
}

.login-copy {
  display: grid;
  gap: 0.7rem;
  text-align: center;
  justify-items: center;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(35, 48, 58, 0.1);
}

.login-copy p {
  max-width: 42ch;
  margin: 0;
}

.login-intro {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.44;
}

.login-form {
  display: grid;
  gap: 0.72rem;
  max-width: 286px;
  width: 100%;
  margin: 0 auto;
}

.login-form label {
  font-size: 0.85rem;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 40px;
  padding: 0.68rem 0.88rem;
  border-radius: 10px;
  border: 1px solid rgba(35, 48, 58, 0.18);
  background: #fff;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(35, 48, 58, 0.04);
}

.login-form input::placeholder {
  color: #9aa4ab;
}

.login-form input:focus {
  outline: 2px solid rgba(64, 88, 102, 0.18);
  border-color: var(--accent-strong);
}

.login-form input:disabled {
  background: #f3f5f7;
  color: #7f8b92;
  cursor: not-allowed;
}

.login-form .primary-button {
  width: 100%;
  margin-top: 0.25rem;
  min-height: 44px;
  border-radius: 10px;
  background: linear-gradient(180deg, #4b6675 0%, #405866 100%);
  box-shadow: 0 8px 20px rgba(35, 48, 58, 0.16);
  font-size: 0.94rem;
  font-weight: 700;
}

.login-form .primary-button:hover {
  background: linear-gradient(180deg, #405866 0%, #364d59 100%);
}

.login-form .primary-button:disabled,
.login-form .primary-button:disabled:hover {
  transform: none;
  background: linear-gradient(180deg, #91a0a8 0%, #7b8a92 100%);
  box-shadow: none;
  cursor: not-allowed;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  line-height: 1.44;
}

.flash-error {
  background: rgba(140, 47, 57, 0.08);
  border-color: rgba(140, 47, 57, 0.2);
  color: var(--danger);
}

.flash-info {
  background: rgba(27, 95, 139, 0.08);
  border-color: rgba(27, 95, 139, 0.18);
  color: var(--info);
}

@media (max-width: 760px) {
  .shell {
    padding-top: 2rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-logo img {
    height: 64px;
  }

  .login-header {
    padding-top: 0.35rem;
  }

  .login-brand img {
    height: 72px;
  }

  .login-header__bar {
    min-height: auto;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 0.2rem;
  }

  .login-header__title {
    width: 100%;
    text-align: center;
  }

  .login-header__search {
    display: none;
  }

  .login-tabs {
    padding-bottom: 0.65rem;
  }

  .login-tabs__inner {
    justify-content: center;
    gap: 1.15rem;
    flex-wrap: wrap;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 1.4rem;
  }

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

  .support-actions a {
    width: 100%;
  }

  .login-panel {
    padding: 1.2rem 1rem 1.3rem;
  }

  .login-panel h1 {
    font-size: 1.08rem;
  }

  .login-intro {
    font-size: 0.8rem;
  }
}

@media (max-height: 760px) {
  .login-header {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .login-header__bar {
    min-height: 5.4rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
  }

  .login-brand img {
    height: 68px;
  }

  .login-shell {
    padding-top: 1.45rem;
    padding-bottom: 1.35rem;
  }

  .login-tabs {
    padding-bottom: 0.6rem;
  }

  .login-panel {
    gap: 0.85rem;
    padding: 1.25rem 1.5rem 1.4rem;
  }

  .login-copy {
    gap: 0.45rem;
    padding-bottom: 0.75rem;
  }

  .login-panel h1 {
    font-size: 1.08rem;
  }

  .login-copy p {
    max-width: 40ch;
    line-height: 1.4;
  }

  .login-intro {
    font-size: 0.76rem;
  }

  .login-form {
    gap: 0.62rem;
    max-width: 272px;
  }

  .login-form label {
    font-size: 0.82rem;
  }

  .login-form input {
    min-height: 36px;
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
    font-size: 0.8rem;
  }

  .login-form .primary-button {
    min-height: 40px;
  }
}
