* { box-sizing: border-box; }

:focus-visible {
  outline: 2px solid var(--accent, #4c9be6);
  outline-offset: 2px;
}

/* 2.4.11 Focus Not Obscured: keep focused elements clear of the sticky nav. */
html {
  scroll-padding-top: 76px;
}

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

:root {
  color-scheme: dark;
  --bg: #0b0d11;
  --surface: #14171d;
  --surface-2: #1b1f27;
  --line: #262b35;
  --line-ui: #626771; /* 3:1 min against --surface — use for input/control borders */
  --text: #e7ebf3;
  --dim: #98a0ae;
  --placeholder: #78808e; /* 4.5:1 against --surface */
  --accent: #4c9be6;
  --accent-2: #7b6fe0;
  --accent-tint: rgba(76, 155, 230, .14);
  --danger: #e6604c;
  --ok: #4cc28a;
  --radius-m: 10px;
  --radius-l: 16px;
}

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Screen-reader-only; visually hidden but announced by assistive tech. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 16px;
  background: var(--accent);
  color: #061018;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: clamp(20px, 5vw, 40px);
}

/* --- Card --- */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: clamp(24px, 5vw, 40px);
}

.card h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -.01em;
}

.card .subhead {
  color: var(--dim);
  font-size: 15px;
  margin: 0 0 28px;
  line-height: 1.5;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-ui);
  border-radius: var(--radius-m);
  background: rgba(20, 23, 29, .6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}

.form-group input::placeholder {
  color: var(--placeholder);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.form-header label {
  margin: 0;
}

.form-header a {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

.form-header a:hover {
  color: #5aa7ee;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-m);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font: inherit;
  text-decoration: none; /* covers <a class="btn ..."> links too */
}

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, #5aa7ee, #3f86d4);
  color: #061018;
  box-shadow: 0 6px 20px -6px rgba(76, 155, 230, .55);
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 26px -6px rgba(76, 155, 230, .7);
}

.btn-primary:active {
  filter: brightness(.96);
}

.btn-primary:disabled {
  opacity: .6;
  cursor: default;
  filter: none;
  box-shadow: none;
}

.btn-secondary {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  margin-bottom: 10px;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(76, 155, 230, .08);
}

.btn-secondary:active {
  background: rgba(76, 155, 230, .14);
}

.btn-secondary:disabled {
  opacity: .5;
  cursor: not-allowed;
  position: relative;
}

.btn-secondary:disabled::after {
  content: "coming soon";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 11, 15, .95);
  color: var(--dim);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 400;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 10;
}


/* --- Footer / Links --- */
.card-footer {
  text-align: center;
  font-size: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.card-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

.card-footer a:hover {
  color: #5aa7ee;
}

.card-footer a.link-underline {
  text-decoration: underline;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  transition: color .2s;
}

.link-btn:hover {
  color: #5aa7ee;
}

/* --- Messages --- */
.form-msg {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
  padding: 0 4px;
}

.form-msg.ok {
  color: var(--ok);
}

.form-msg.err {
  color: var(--danger);
}

.form-msg.info {
  color: var(--accent);
}

/* --- Auth-page consent disclaimer (not the site footer) --- */
.auth-disclaimer {
  text-align: center;
  color: var(--placeholder);
  font-size: 12px;
  padding: 0;
  margin: 0;
}

.auth-disclaimer a {
  color: inherit;
  text-decoration: underline;
}

/* --- Auth split layout (login/signup/forgot) --- */
main.auth-split {
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.auth-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: clamp(20px, 5vw, 40px);
}

.auth-image {
  flex: 1;
  overflow: hidden;
  background: var(--surface);
}

.auth-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 900px) {
  .auth-image {
    display: none;
  }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .card {
    max-width: 100%;
  }

  .btn-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .form-row {
    flex-direction: column;
    gap: 20px;
  }

  .form-row .form-group {
    margin-bottom: 0;
  }
}
