/* Dharma auth pages — mobile-first */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.auth-card--wide {
  max-width: 440px;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.auth-logo-img {
  width: 120px;
  height: auto;
  border-radius: 12px;
}

.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #2d6a4f;
  letter-spacing: -0.02em;
}

.auth-card h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.15rem;
}

.auth-sub {
  margin: 0 0 1.5rem;
  color: #5a5a5a;
  font-size: 0.95rem;
  line-height: 1.5;
}

form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

form input[type="text"],
form input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.85rem 0.9rem;
  border: 1.5px solid #d6d6ce;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 400;
  background: #fafaf7;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  font-family: inherit;
}

form input:focus {
  outline: none;
  border-color: #2d6a4f;
  background: #ffffff;
}

.trust-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.trust-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2d6a4f;
  cursor: pointer;
  margin: 0;
}

.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 3rem;
}
.pw-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  min-height: 2.4rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #5a5a5a;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-toggle:hover { background: #f0efe9; color: #2d6a4f; }
.pw-toggle:focus-visible { outline: 2px solid #2d6a4f; outline-offset: 2px; }
.pw-toggle[aria-pressed="true"] { color: #2d6a4f; }
.pw-toggle[aria-pressed="true"] .pw-eye::after { content: "\\"; }

button {
  display: block;
  width: 100%;
  padding: 0.9rem;
  margin-top: 0.5rem;
  background: #2d6a4f;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  min-height: 48px;
}

button:hover:not(:disabled) { background: #235640; }
button:active:not(:disabled) { background: #1c4633; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error {
  margin: 0.75rem 0 0;
  min-height: 1.2em;
  color: #b32222;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-footer {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}
.auth-footer a { color: #5a5a5a; }

.qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #fafaf7;
  border-radius: 12px;
}
.qr-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

details {
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}
details summary {
  cursor: pointer;
  color: #2d6a4f;
  font-weight: 500;
  padding: 0.25rem 0;
}
.secret-code {
  display: block;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #fafaf7;
  border: 1px solid #e0e0d8;
  border-radius: 8px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
}

.backup-codes {
  list-style: none;
  padding: 1rem;
  margin: 1rem 0;
  background: #fafaf7;
  border: 1px solid #e0e0d8;
  border-radius: 10px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.backup-codes li {
  padding: 0.35rem 0.5rem;
  background: #ffffff;
  border-radius: 6px;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  user-select: all;
}

@media (max-width: 380px) {
  .auth-card { padding: 1.5rem 1.25rem; }
  .backup-codes { grid-template-columns: 1fr; }
}
