:root {
  color-scheme: dark;
  --bg: #05080b;
  --panel: rgba(9, 15, 20, .82);
  --line: rgba(195, 226, 236, .16);
  --line-strong: rgba(39, 216, 255, .40);
  --text: #f2f7f9;
  --muted: #afbec5;
  --cyan: #27d8ff;
  --green: #75f0a7;
  --red: #ff6d6d;
  --shadow: 0 22px 60px rgba(0, 0, 0, .38);
  --radius: 8px;
  --max: 1180px;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.clockwork-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #02050b;
}

.clockwork-bg iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  opacity: .44;
  filter: saturate(.86) contrast(1.08);
}

.clockwork-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 5, 8, .76), rgba(2, 5, 8, .30) 36%, rgba(2, 5, 8, .84) 100%),
    radial-gradient(circle at 50% 12%, rgba(39, 216, 255, .10), transparent 32%);
}

.site-header,
.auth-shell {
  position: relative;
  z-index: 2;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 11, .86);
  backdrop-filter: blur(16px);
}

.nav {
  width: min(100% - 32px, var(--max));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(39, 216, 255, .18), rgba(117, 240, 167, .08));
  color: var(--cyan);
  font-weight: 900;
  box-shadow: 0 0 22px rgba(39, 216, 255, .10);
  animation: brandPulse 4s ease-in-out infinite;
}

.brand-name {
  display: block;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 900;
  letter-spacing: .02em;
  background: linear-gradient(90deg, #f4fbff, var(--cyan), #f4fbff);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandSweep 5.8s ease-in-out infinite;
}

.brand-domain {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

@keyframes brandSweep {
  0%, 100% { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(39, 216, 255, .10); }
  50% { box-shadow: 0 0 30px rgba(39, 216, 255, .24); }
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 15px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.button.primary {
  background: var(--cyan);
  color: #041014;
  box-shadow: 0 12px 28px rgba(39, 216, 255, .18);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
}

.glyph {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
  font-size: 13px;
  line-height: 1;
}

.auth-shell {
  width: min(100% - 32px, var(--max));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 460px);
  gap: 32px;
  align-items: center;
  padding: 64px 0;
}

.auth-copy h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: .95;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: #cfdae0;
  font-size: 18px;
}

.title-kicker {
  display: block;
  color: var(--cyan);
}

.auth-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: linear-gradient(180deg, rgba(15, 25, 31, .94), rgba(8, 14, 18, .92));
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.auth-note {
  margin: 0 0 18px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, .24);
  color: var(--text);
  font: inherit;
}

.fine-print,
.auth-message {
  color: var(--muted);
  font-size: 13px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
}

.auth-message.error {
  color: var(--red);
}

.switch-link {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.switch-link a {
  color: var(--cyan);
  font-weight: 900;
}

@media (max-width: 820px) {
  .nav,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .nav {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav .button {
    width: 100%;
  }

  .auth-shell {
    min-height: auto;
    padding: 48px 0;
  }
}
