/* Standalone login page (login.html). Reuses the site's brand tokens from
   styles.css; this file only styles the login card and its controls. The
   layout mirrors the standard "Log in or sign up" pattern: provider pills,
   an OR separator, then email + continue. */

/* Fill the viewport so the card centers vertically; the header stays a normal
   flow child (styles.css already styles .site-header / .brand). */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) 0;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-sm);
  text-wrap: balance;
}

.login-sub {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-lg);
  text-wrap: balance;
}

/* ---- Provider pills ---- */
.login-providers {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.login-card .btn-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.login-card .btn-provider:hover {
  background: var(--surface-alt);
  border-color: var(--text-faint);
}

.login-card .btn-provider svg {
  flex: none;
}

/* ---- OR separator ---- */
.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

/* ---- Email / code forms ---- */
.login-card form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
}

/* display:flex above would defeat the hidden attribute the step-swap relies on. */
.login-card form[hidden] {
  display: none;
}

.login-card input {
  width: 100%;
  margin: 0;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-base);
}

.login-card input::placeholder {
  color: var(--text-faint);
}

.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.login-card .btn-continue {
  width: 100%;
  padding: 12px 16px;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--on-primary);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-card .btn-continue:hover {
  background: var(--primary-hover);
}

.login-card .btn-continue:disabled,
.login-card .btn-provider:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Secondary, link-like action ("Use a different email / account"). */
.login-card .btn-switch {
  align-self: center;
  width: auto;
  margin-top: var(--space-xs);
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.login-card .btn-switch:hover {
  color: var(--text);
  background: transparent;
}

.code-prompt {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-xs);
  text-wrap: balance;
}

/* ---- Status / error line ---- */
.login-msg {
  min-height: 1.4em;
  margin: var(--space-md) 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.login-msg.is-error {
  color: #ef4444;
}

/* Signed-in shortcut */
#signed-in {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

#signed-in[hidden] {
  display: none;
}

/* ---- Footer ---- */
.login-footer {
  padding: var(--space-md) 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.login-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--text);
}
