/**
 * LibZen LoginScreen styles (NetZen / TripZen auth form).
 * Host app may define theme tokens; fallbacks match Zen dark theme.
 */

:root {
  --libzen-ls-bg: var(--bg, #0f1419);
  --libzen-ls-text: var(--text, #e8edf4);
  --libzen-ls-muted: var(--text-muted, var(--muted, #8b9cb3));
  --libzen-ls-border: var(--border, #2d3a4f);
  --libzen-ls-accent: var(--accent, #3b82f6);
  --libzen-ls-accent-dim: var(--accent-dim, #2563eb);
  --libzen-ls-danger: var(--danger, #ef4444);
  --libzen-ls-radius: var(--btn-radius, 6px);
  --libzen-ls-focus-ring: var(--btn-focus-ring, 2px solid var(--libzen-ls-accent));
}

.libzen-ls-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--libzen-ls-bg);
  color: var(--libzen-ls-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.libzen-ls-form {
  width: 100%;
  max-width: 420px;
}

.libzen-ls-form h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.libzen-ls-error {
  color: var(--libzen-ls-danger);
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.libzen-ls-fields label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--libzen-ls-muted);
  font-size: 0.9rem;
}

.libzen-ls-fields input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: var(--libzen-ls-radius);
  border: 1px solid var(--libzen-ls-border);
  background: var(--libzen-ls-bg);
  color: var(--libzen-ls-text);
  font: inherit;
  box-sizing: border-box;
}

.libzen-ls-fields input:focus {
  outline: none;
  border-color: var(--libzen-ls-accent);
}

/* Password sits in a relative box so the reveal control can pin to its right
   edge. Host apps often style every `button` as a wide filled CTA (NetZen
   uses a 6rem min-width); the toggle opts out of that. */
.libzen-ls-password-field {
  position: relative;
  display: block;
  margin-bottom: 1rem;
}

.libzen-ls-fields .libzen-ls-password-field input {
  margin-bottom: 0;
  padding-right: 2.5rem;
}

.libzen-ls-password-field input::-ms-reveal,
.libzen-ls-password-field input::-ms-clear {
  display: none;
}

.libzen-ls-password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  z-index: 1;
  width: 2.25rem;
  max-width: 2.25rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0 calc(var(--libzen-ls-radius) - 1px) calc(var(--libzen-ls-radius) - 1px) 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--libzen-ls-muted);
  font: inherit;
  font-size: 1rem;
  line-height: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.libzen-ls-password-toggle:hover,
.libzen-ls-password-toggle:focus-visible {
  background: color-mix(in srgb, var(--libzen-ls-text) 8%, transparent);
  background-image: none;
  color: var(--libzen-ls-text);
}

.libzen-ls-password-toggle:focus-visible {
  outline: var(--libzen-ls-focus-ring);
  outline-offset: -2px;
}

.libzen-ls-password-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}

.libzen-ls-submit {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--libzen-ls-radius);
  background: var(--libzen-ls-accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.libzen-ls-submit:hover:not(:disabled) {
  background: var(--libzen-ls-accent-dim);
}

.libzen-ls-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.libzen-ls-submit:focus-visible {
  outline: var(--libzen-ls-focus-ring);
  outline-offset: 2px;
}

.libzen-ls-links {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.libzen-ls-link {
  font: inherit;
  font-size: inherit;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--libzen-ls-text);
  cursor: pointer;
  text-decoration: none;
}

.libzen-ls-link:hover {
  color: var(--libzen-ls-accent);
}

.libzen-ls-link-muted {
  opacity: 0.6;
}
