:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #9aa8bc;
  --panel: rgba(13, 21, 35, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #58d6c7;
  --accent-strong: #38bfae;
  --danger: #ff9eaa;
  --focus: #8ce9dd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(40, 137, 148, 0.26), transparent 33rem),
    radial-gradient(circle at 85% 85%, rgba(67, 77, 154, 0.2), transparent 30rem),
    #07101d;
}

button, input { font: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(24rem, 0.95fr);
}

.brand-panel,
.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 28rem;
  height: 28rem;
  right: -14rem;
  bottom: -12rem;
  border: 1px solid rgba(88, 214, 199, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(88, 214, 199, 0.025), 0 0 0 10rem rgba(88, 214, 199, 0.02);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(88, 214, 199, 0.55);
  border-radius: 1rem;
  color: #07101d;
  background: var(--accent);
  font-size: 1.6rem;
  font-weight: 800;
  box-shadow: 0 1rem 3rem rgba(56, 191, 174, 0.18);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.brand-copy {
  max-width: 38rem;
  margin: 1.7rem 0 2rem;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.trust-row span {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #cbd5e2;
  font-size: 0.75rem;
}

.form-card {
  width: min(100%, 29rem);
  margin: auto;
  padding: clamp(1.6rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.035em;
}

.form-intro {
  margin: 0.65rem 0 1.8rem;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 0.55rem;
  color: #d9e1eb;
  font-size: 0.86rem;
  font-weight: 650;
}

input {
  width: 100%;
  height: 3.25rem;
  margin-bottom: 1.25rem;
  padding: 0 0.95rem;
  border: 1px solid #34445a;
  border-radius: 0.75rem;
  outline: none;
  color: var(--ink);
  background: #0a1525;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(88, 214, 199, 0.15);
}

.password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-button {
  margin: -0.25rem 0 0.3rem;
  padding: 0.25rem;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  height: 3.25rem;
  border: 0;
  border-radius: 0.75rem;
  color: #06110f;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.submit-button:hover { background: var(--accent-strong); }
.submit-button:active { transform: translateY(1px); }
.submit-button:disabled { cursor: wait; opacity: 0.72; }

.spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(6, 17, 15, 0.3);
  border-top-color: #06110f;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.submit-button.is-loading .spinner { display: block; }

.message {
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.7rem;
  font-size: 0.87rem;
  line-height: 1.45;
}

.message-error {
  color: #ffdbe0;
  border: 1px solid rgba(255, 158, 170, 0.32);
  background: rgba(126, 35, 51, 0.24);
}

.message-info {
  color: #d9f9f5;
  border: 1px solid rgba(88, 214, 199, 0.3);
  background: rgba(25, 100, 94, 0.22);
}

.authenticated-state {
  padding: 1rem;
  border: 1px solid rgba(88, 214, 199, 0.35);
  border-radius: 0.8rem;
  background: rgba(25, 100, 94, 0.16);
}

.success-title { margin: 0; font-weight: 800; }
.authenticated-state p { color: #cbd7e5; }
.authenticated-state a { color: var(--accent); font-weight: 700; }

.parallel-notice {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: #8290a4;
  font-size: 0.75rem;
  line-height: 1.5;
}

[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .form-panel { padding-top: 3rem; padding-bottom: 3rem; }
  h1 { max-width: 16ch; }
}

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