* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: #f8f6ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #0c0b19;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.home-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(90, 52, 170, 0.32), transparent 34%),
    linear-gradient(210deg, rgba(17, 80, 105, 0.28), transparent 42%),
    #0c0b19;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 128px;
  padding: 18px 8%;
  background: rgba(8, 8, 20, 0.86);
  border-bottom: 1px solid rgba(174, 143, 255, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: inherit;
}

.brand-logo {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(132, 91, 255, 0.32);
  object-fit: cover;
}

.site-header .brand-logo {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
}

.brand strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.site-header .brand strong {
  font-size: 32px;
}

.brand em {
  display: block;
  margin-top: 6px;
  color: #b9b2cc;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
}

.site-header .brand em {
  font-size: 18px;
}

.site-nav,
.hero-actions,
.auth-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-button:hover {
  transform: translateY(-1px);
}

.site-button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #805cff, #c95cff);
  box-shadow: 0 18px 42px rgba(160, 91, 255, 0.3);
}

.site-button-secondary {
  color: #d8d0f0;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(174, 143, 255, 0.24);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.88fr);
  gap: 58px;
  width: min(1720px, 84%);
  margin: 0 auto;
  padding: 74px 0 92px;
  align-items: center;
}

.site-logo {
  display: block;
  width: auto;
  max-width: min(220px, 60vw);
  max-height: 72px;
  margin-bottom: 20px;
  object-fit: contain;
}

.hero-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: 68px;
  line-height: 1.06;
  font-weight: 800;
}

.hero-copy h1 span,
.hero-lead span {
  display: block;
}

.hero-lead {
  margin: 14px 0 0;
  color: #a775ff;
  font-size: 52px;
  line-height: 1.08;
  font-weight: 800;
}

.hero-desc {
  max-width: 760px;
  margin: 30px 0 0;
  color: #b9b2cc;
  font-size: 20px;
  line-height: 1.8;
}

.quick-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.quick-card,
.feature-card,
.metric-item,
.workflow-panel {
  background: rgba(21, 21, 44, 0.7);
  border: 1px solid rgba(162, 131, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.quick-card {
  min-height: 190px;
  padding: 28px 24px;
}

.quick-card span,
.metric-item span,
.feature-card span {
  display: block;
  color: #8d86a3;
  font-size: 15px;
  font-weight: 700;
}

.quick-card strong {
  display: block;
  margin-top: 22px;
  color: #ffffff;
  font-size: 22px;
}

.quick-card p,
.feature-card p,
.panel-note {
  color: #b9b2cc;
  line-height: 1.8;
}

.quick-card p {
  margin: 20px 0 0;
  font-size: 17px;
}

.hero-actions {
  margin-top: 34px;
}

.connection-status {
  color: #b9b2cc;
  font-size: 15px;
}

.workflow-panel {
  padding: 36px;
  background:
    linear-gradient(160deg, rgba(88, 67, 160, 0.28), transparent 46%),
    rgba(18, 20, 43, 0.82);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #bfb8d5;
  font-size: 20px;
}

.panel-title span {
  width: 12px;
  height: 12px;
  background: #9562ff;
  border-radius: 999px;
  box-shadow: 0 0 0 8px rgba(149, 98, 255, 0.13);
}

.flow-line {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 38px;
}

.flow-line b {
  min-height: 48px;
  padding: 12px 16px;
  color: #d8d0f0;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(175, 155, 255, 0.22);
  border-radius: 999px;
}

.flow-line i {
  height: 1px;
  background: linear-gradient(90deg, rgba(151, 109, 255, 0.12), rgba(151, 109, 255, 0.7));
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.metric-item {
  min-height: 118px;
  padding: 24px;
}

.metric-item strong {
  display: block;
  margin-top: 18px;
  color: #ffffff;
  font-size: 22px;
}

.panel-note {
  margin: 24px 0 0;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(175, 155, 255, 0.18);
  border-radius: 8px;
  font-size: 17px;
}

.feature-section {
  width: min(1480px, 84%);
  margin: 0 auto;
  padding: 36px 0 86px;
}

.section-heading {
  max-width: 760px;
}

.section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 36px;
}

.section-heading p {
  margin: 16px 0 0;
  color: #b9b2cc;
  font-size: 18px;
  line-height: 1.8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.feature-card {
  min-height: 198px;
  padding: 26px;
}

.feature-card h3 {
  margin: 22px 0 0;
  color: #ffffff;
  font-size: 22px;
}

.feature-card p {
  margin: 16px 0 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 8%;
  background: rgba(8, 8, 20, 0.92);
  border-top: 1px solid rgba(174, 143, 255, 0.12);
}

.brand.compact .brand-logo {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.brand.compact strong {
  font-size: 18px;
}

.brand.compact em {
  font-size: 13px;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(92, 52, 160, 0.34), transparent 36%),
    linear-gradient(220deg, rgba(84, 73, 190, 0.3), transparent 40%),
    #0c0b19;
}

.auth-page::before,
.auth-page::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.auth-page::before {
  inset: auto auto 8% 9%;
  width: 260px;
  height: 260px;
  background: rgba(113, 82, 255, 0.13);
  filter: blur(36px);
}

.auth-page::after {
  top: 10%;
  right: 8%;
  width: 360px;
  height: 360px;
  background: rgba(93, 78, 179, 0.2);
  filter: blur(44px);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(700px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

.error-shell {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(620px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20vh 0 34px;
  text-align: center;
}

.error-code {
  color: #a775ff;
  font-size: 144px;
  font-weight: 800;
  line-height: 0.95;
}

.error-shell h1 {
  margin: 24px 0 0;
  color: #ffffff;
  font-size: 32px;
}

.error-shell p {
  margin: 14px 0 0;
  color: #b9b2cc;
  font-size: 17px;
  line-height: 1.8;
}

.error-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.error-actions .auth-secondary {
  width: auto;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: inherit;
  text-align: left;
}

.auth-brand .brand-logo {
  width: 76px;
  height: 76px;
  flex-basis: 76px;
  flex-shrink: 0;
}

.auth-brand strong {
  min-width: 0;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.2;
}

.auth-brand em {
  color: #b9b2cc;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
}

.auth-card {
  width: 100%;
  margin-top: 20px;
  padding: 34px;
  background: rgba(17, 18, 39, 0.82);
  border: 1px solid rgba(162, 131, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.auth-heading {
  margin-bottom: 30px;
  text-align: center;
}

.auth-heading h1 {
  margin: 0;
  color: #ffffff;
  font-size: 30px;
}

.auth-heading p {
  margin: 14px 0 0;
  color: #b9b2cc;
  font-size: 16px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: #ffffff;
  font-weight: 700;
}

.field-input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  color: #ffffff;
  background: #0c1728;
  border: 1px solid rgba(93, 119, 164, 0.48);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(106, 78, 180, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field-input::placeholder {
  color: #8f98b4;
}

.field-input:focus {
  background: #0e1b30;
  border-color: rgba(118, 96, 210, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(118, 96, 210, 0.22),
    0 0 0 3px rgba(126, 96, 255, 0.12);
  outline: none;
}

.auth-help {
  margin: -4px 0 4px;
  color: #8d86a3;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 12px;
  align-items: stretch;
}

.captcha-image {
  display: grid;
  place-items: center;
  width: 124px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  color: #3edfd0;
  background: #0c1728;
  border: 1px solid rgba(93, 119, 164, 0.48);
  border-radius: 8px;
  cursor: pointer;
}

.captcha-image:hover,
.captcha-image:focus {
  border-color: rgba(118, 96, 210, 0.72);
  box-shadow: 0 0 0 3px rgba(126, 96, 255, 0.12);
}

.captcha-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #ffffff;
  line-height: 1.7;
}

.checkbox-row input {
  margin-top: 3px;
}

.checkbox-row a,
.auth-links a {
  color: #3edfd0;
}

.auth-submit,
.auth-secondary {
  width: 100%;
  min-height: 58px;
}

.auth-secondary {
  color: #3edfd0;
  background: rgba(62, 223, 208, 0.08);
  border-color: rgba(62, 223, 208, 0.36);
  box-shadow: 0 14px 34px rgba(18, 224, 202, 0.08);
}

.auth-secondary:hover,
.auth-secondary:focus {
  color: #ffffff;
  background: rgba(62, 223, 208, 0.16);
  border-color: rgba(62, 223, 208, 0.62);
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
  color: #b9b2cc;
  font-size: 16px;
}

.auth-copy {
  margin: 20px 0 0;
  color: #77718d;
}

.page-alert {
  display: none;
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.6;
}

.page-alert.show {
  display: block;
}

.page-alert.error {
  color: #ffd7d8;
  background: rgba(210, 76, 91, 0.18);
  border: 1px solid rgba(255, 126, 142, 0.24);
}

.page-alert.success {
  color: #d1ffe9;
  background: rgba(18, 224, 202, 0.14);
  border: 1px solid rgba(62, 223, 208, 0.24);
}

@media (max-width: 1180px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 58px;
  }

  .hero-lead {
    font-size: 42px;
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-section,
  .feature-section {
    width: calc(100% - 32px);
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-lead {
    font-size: 30px;
  }

  .site-header .brand-logo {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .site-header .brand strong {
    font-size: 28px;
  }

  .site-header .brand em {
    font-size: 16px;
  }

  .quick-cards,
  .metric-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .flow-line {
    grid-template-columns: 1fr;
  }

  .flow-line i {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-nav,
  .hero-actions {
    align-items: stretch;
    width: 100%;
    flex-direction: column;
  }

  .site-button {
    width: 100%;
  }

  .workflow-panel {
    padding: 24px;
  }

  .brand {
    align-items: flex-start;
    width: 100%;
  }

  .auth-card {
    padding: 24px;
  }

  .auth-brand {
    gap: 12px;
    max-width: 100%;
  }

  .auth-brand .brand-logo {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .auth-brand strong {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .error-shell {
    padding-top: 14vh;
  }

  .error-code {
    font-size: 96px;
  }

  .error-actions {
    align-items: stretch;
    width: 100%;
    flex-direction: column;
  }

  .error-actions .site-button {
    width: 100%;
  }

  .auth-links {
    align-items: center;
    flex-direction: column;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .captcha-image {
    width: 100%;
  }
}
