:root {
  color-scheme: dark;
  --bg: #0c0e13;
  --surface: #121620;
  --surface-hover: #171c28;
  --text: #f7f8fb;
  --muted: #9da6ba;
  --muted-strong: #bdc4d2;
  --border: #2a3040;
  --border-strong: #48516a;
  --accent: #6d74ff;
  --accent-bright: #858bff;
  --danger: #ff666d;
  --radius: 16px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 30%, rgba(75, 83, 145, 0.12), transparent 34rem),
    var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.networkBackdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.52;
}

.networkLine {
  position: absolute;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 2%,
    rgba(110, 121, 164, 0.3) 20%,
    rgba(110, 121, 164, 0.12) 80%,
    transparent 98%
  );
}

.networkLine::before,
.networkLine::after {
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(109, 116, 255, 0.08);
  transform: translateX(-50%);
}

.networkLine::before {
  top: 14%;
}

.networkLine::after {
  top: 72%;
}

.networkLineOne {
  left: 19%;
}

.networkLineTwo {
  left: 50%;
}

.networkLineThree {
  left: 81%;
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: var(--text);
  font-size: 24px;
  font-weight: 720;
  letter-spacing: 0.17em;
  text-decoration: none;
}

.brandMark {
  position: relative;
  display: block;
  width: 28px;
  height: 24px;
}

.brandMark::before,
.brandMark::after {
  position: absolute;
  bottom: 0;
  width: 9px;
  height: 24px;
  content: "";
  background: linear-gradient(180deg, var(--accent-bright), #4d56e7);
  transform: skew(-25deg);
}

.brandMark::before {
  left: 5px;
}

.brandMark::after {
  right: 3px;
  height: 14px;
}

.loginHeader {
  position: absolute;
  z-index: 1;
  top: 38px;
  left: 44px;
}

.loginMain {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: 118px 24px 72px;
  place-items: center;
}

.loginPanel {
  width: min(100%, 548px);
  padding: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(24, 29, 40, 0.96), rgba(16, 20, 29, 0.97));
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.36),
    inset 0 1px rgba(255, 255, 255, 0.025);
}

.loginPanel h1,
.hubIntro h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.loginPanel h1 {
  text-align: center;
}

.loginLead {
  margin: 14px 0 40px;
  color: var(--muted-strong);
  font-size: 18px;
  text-align: center;
}

.loginForm {
  display: grid;
  gap: 10px;
}

.loginForm label {
  margin-top: 8px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 650;
}

.field {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 10, 15, 0.42);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field:focus-within {
  border-color: var(--accent);
  background: rgba(11, 13, 20, 0.72);
  box-shadow: 0 0 0 3px rgba(109, 116, 255, 0.1);
}

.fieldError {
  border-color: var(--danger);
}

.field > svg,
.passwordToggle svg,
.primaryButton svg,
.securityNote svg,
.logoutButton svg,
.headerButton svg,
.rotationSecurityNote svg,
.restartIcon svg,
.serviceOpen svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.field > svg {
  color: #7f899e;
}

.field input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.field input::placeholder {
  color: #687186;
}

.passwordToggle {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #929bb0;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.passwordToggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.formError {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.primaryButton {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-top: 18px;
  border: 1px solid #747bff;
  border-radius: 10px;
  color: white;
  background: linear-gradient(110deg, #535cf3, #6e6bf4);
  box-shadow: 0 12px 30px rgba(65, 73, 220, 0.18);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.primaryButton:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 15px 36px rgba(65, 73, 220, 0.25);
  transform: translateY(-1px);
}

.primaryButton:disabled {
  cursor: wait;
  opacity: 0.72;
}

.securityNote {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 24px 0 0;
  color: #8e97ab;
  font-size: 14px;
}

.securityNote svg {
  width: 18px;
  height: 18px;
}

.appHeader {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid rgba(72, 81, 106, 0.46);
  background: rgba(12, 14, 19, 0.8);
  backdrop-filter: blur(16px);
}

.headerActions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.headerActions form {
  margin: 0;
}

.logoutButton,
.headerButton {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(109, 116, 255, 0.74);
  border-radius: 10px;
  color: var(--text);
  background: rgba(13, 16, 24, 0.72);
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.logoutButton {
  min-height: 48px;
  padding: 0 18px;
}

.logoutButton:hover,
.headerButton:hover {
  border-color: var(--accent-bright);
  background: rgba(109, 116, 255, 0.12);
  transform: translateY(-1px);
}

.headerButton {
  min-height: 48px;
  padding: 0 18px;
}

.hubMain {
  position: relative;
  z-index: 1;
  width: min(100%, 1400px);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 48px clamp(24px, 5vw, 80px) 36px;
}

.hubIntro {
  margin-bottom: 34px;
}

.hubIntro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.serviceDirectory {
  display: grid;
  gap: 18px;
  margin: 0;
}

.serviceSection {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 0 0, rgba(109, 116, 255, 0.11), transparent 18rem),
    linear-gradient(145deg, rgba(20, 24, 35, 0.98), rgba(14, 17, 25, 0.97));
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.17);
}

.serviceSectionHeader {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 26px;
  border-right: 1px solid rgba(72, 81, 106, 0.58);
  background: rgba(109, 116, 255, 0.035);
}

.serviceSectionIcon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(109, 116, 255, 0.5);
  border-radius: 14px;
  background: rgba(109, 116, 255, 0.09);
  font-size: 24px;
  line-height: 1;
  place-items: center;
}

.serviceSectionHeader h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.serviceSectionCount {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.serviceList {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.serviceList li + li {
  border-top: 1px solid rgba(72, 81, 106, 0.48);
}

.serviceItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 96px;
  padding: 21px 24px;
  color: var(--text);
  text-decoration: none;
  transition: background 170ms ease, box-shadow 170ms ease;
}

.serviceItem:hover {
  background: linear-gradient(90deg, rgba(109, 116, 255, 0.08), rgba(109, 116, 255, 0.025));
  box-shadow: inset 3px 0 var(--accent);
}

.serviceCopy {
  display: block;
  min-width: 0;
}

.serviceCopy strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.serviceCopy > span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.serviceMeta {
  display: flex;
  gap: 18px;
  align-items: center;
}

.serviceAccess {
  padding: 5px 9px;
  border: 1px solid rgba(72, 81, 106, 0.72);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(8, 10, 15, 0.28);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.serviceOpen {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--accent-bright);
  font-size: 13px;
  font-weight: 700;
}

.serviceOpen svg {
  width: 18px;
  height: 18px;
  transition: transform 180ms ease;
}

.serviceItem:hover .serviceOpen svg {
  transform: translateX(3px);
}

.passwordMain {
  position: relative;
  z-index: 1;
  width: min(100%, 1280px);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 54px clamp(24px, 5vw, 76px) 48px;
}

.passwordIntro {
  margin-bottom: 32px;
}

.eyebrow,
.panelLabel {
  margin: 0;
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.passwordIntro h1 {
  margin: 8px 0 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.passwordIntro > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.passwordWorkspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.22fr);
  gap: 18px;
  align-items: start;
}

.targetPanel,
.rotationPanel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(19, 23, 34, 0.97), rgba(14, 17, 25, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.targetPanel {
  padding: 24px 18px 18px;
}

.targetPanel > .panelLabel {
  padding: 0 8px 14px;
  color: var(--muted);
}

.targetList {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.targetLink {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 13px;
  align-items: center;
  padding: 14px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.targetLink:hover {
  border-color: rgba(109, 116, 255, 0.34);
  background: rgba(109, 116, 255, 0.07);
  transform: translateX(2px);
}

.targetLinkActive {
  border-color: rgba(109, 116, 255, 0.64);
  background: linear-gradient(110deg, rgba(109, 116, 255, 0.16), rgba(109, 116, 255, 0.06));
}

.targetDot {
  width: 8px;
  height: 8px;
  border: 1px solid #777f92;
  border-radius: 50%;
  background: transparent;
}

.targetLinkActive .targetDot {
  border-color: var(--accent-bright);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(109, 116, 255, 0.12);
}

.targetLink strong,
.targetLink small {
  display: block;
}

.targetLink strong {
  font-size: 15px;
  line-height: 1.3;
}

.targetLink small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.rotationPanel {
  padding: 34px;
}

.rotationPanel h2 {
  margin: 9px 0 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.rotationDescription {
  margin: 8px 0 24px;
  color: var(--muted);
}

.rotationForm {
  display: grid;
  gap: 9px;
}

.rotationForm label {
  margin-top: 7px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 650;
}

.passwordField {
  background: rgba(8, 10, 15, 0.5);
}

.passwordHint {
  margin: 2px 0 0;
  color: #858ea2;
  font-size: 13px;
  line-height: 1.45;
}

.rotationButton {
  width: 100%;
  margin-top: 13px;
}

.rotationSecurityNote {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: #929bad;
  font-size: 13px;
}

.rotationSecurityNote svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--accent-bright);
}

.formAlert {
  margin: 0 0 17px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 14px;
}

.formAlertError {
  border-color: rgba(255, 102, 109, 0.48);
  color: #ff8b91;
  background: rgba(255, 102, 109, 0.08);
}

.formAlertSuccess {
  border-color: rgba(91, 213, 157, 0.4);
  color: #82e5b8;
  background: rgba(91, 213, 157, 0.08);
}

.formAlertWarning {
  border-color: rgba(238, 184, 93, 0.42);
  color: #efc77f;
  background: rgba(238, 184, 93, 0.08);
}

.restartMain {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: calc(100vh - 86px);
  padding: 56px 24px;
  place-items: center;
}

.restartPanel {
  width: min(100%, 620px);
  padding: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(24, 29, 40, 0.98), rgba(16, 20, 29, 0.98));
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.restartIcon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  border: 1px solid rgba(109, 116, 255, 0.72);
  border-radius: 50%;
  color: var(--accent-bright);
  background: rgba(109, 116, 255, 0.12);
  place-items: center;
}

.restartIcon svg {
  width: 26px;
  height: 26px;
}

.restartPanel h1 {
  margin: 10px 0 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.restartPanel > p:not(.eyebrow) {
  margin: 18px auto 0;
  color: var(--muted-strong);
  font-size: 17px;
}

.restartButton {
  width: min(100%, 260px);
  margin: 30px auto 0;
  text-decoration: none;
}

.appFooter {
  position: relative;
  z-index: 1;
  min-height: 62px;
  padding: 19px 24px;
  border-top: 1px solid rgba(72, 81, 106, 0.38);
  color: #777f92;
  text-align: center;
}

@media (max-width: 720px) {
  .networkLineOne {
    left: 11%;
  }

  .networkLineThree {
    left: 89%;
  }

  .loginHeader {
    top: 26px;
    left: 24px;
  }

  .brand {
    font-size: 20px;
  }

  .loginMain {
    padding: 98px 16px 38px;
  }

  .loginPanel {
    padding: 34px 22px;
    border-radius: 16px;
  }

  .loginPanel h1 {
    font-size: 34px;
  }

  .loginLead {
    margin-bottom: 28px;
    font-size: 16px;
  }

  .appHeader {
    min-height: 74px;
    padding: 0 18px;
  }

  .logoutButton {
    width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 0;
  }

  .headerActions {
    gap: 7px;
  }

  .headerButton {
    min-height: 44px;
    padding: 0 13px;
    font-size: 14px;
  }

  .logoutButton svg {
    width: 20px;
    height: 20px;
  }

  .hubMain {
    padding: 36px 18px 30px;
  }

  .hubIntro h1 {
    font-size: 36px;
  }

  .hubIntro p {
    font-size: 16px;
  }

  .serviceSection {
    grid-template-columns: minmax(0, 1fr);
  }

  .serviceSectionHeader {
    align-items: center;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(72, 81, 106, 0.58);
  }

  .serviceSectionIcon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 22px;
  }

  .serviceItem {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 19px 20px;
  }

  .serviceMeta {
    justify-content: space-between;
  }

  .passwordMain {
    padding: 36px 18px 32px;
  }

  .passwordIntro h1 {
    font-size: 36px;
  }

  .passwordIntro > p:last-child {
    font-size: 16px;
  }

  .passwordWorkspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .targetPanel {
    padding: 18px 12px 12px;
  }

  .targetList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .targetLink {
    grid-template-columns: 8px 1fr;
    padding: 11px 10px;
  }

  .targetLink small {
    display: none;
  }

  .rotationPanel {
    padding: 26px 20px;
  }

  .restartMain {
    min-height: calc(100vh - 74px);
    padding: 32px 16px;
  }

  .restartPanel {
    padding: 36px 22px;
  }
}

@media (max-width: 460px) {
  .headerButton {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .headerButton svg {
    width: 20px;
    height: 20px;
  }

  .targetList {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
