:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: #171a21;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #4f8cff;
  --error: #ff6b6b;
  --ok: #4caf7d;
  --border: #2a2e37;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

@media (max-width: 420px) {
  body { padding: 16px 12px; }
  .card { padding: 20px; border-radius: 10px; }
  h1 { font-size: 18px; }
}

h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.brand {
  color: var(--accent);
  font-weight: 600;
}

p.subtitle {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 13px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
}

input {
  width: 100%;
  padding: 12px;
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  min-height: 44px;
}

input:focus { outline: 2px solid var(--accent); }

button {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled { opacity: 0.6; cursor: default; }

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  margin-top: 10px;
}

.msg {
  margin-top: 14px;
  font-size: 13px;
  border-radius: 8px;
  padding: 10px 12px;
  display: none;
}

.msg.error { display: block; background: rgba(255,107,107,0.12); color: var(--error); }
.msg.ok { display: block; background: rgba(76,175,125,0.12); color: var(--ok); }

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.actions-row .btn {
  flex: 1;
  width: auto;
  margin-top: 0;
  padding: 12px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.actions-row .btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.links {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.links a { color: var(--accent); text-decoration: none; }

.field {
  display: flex;
  flex-direction: column;
}

.pw-field {
  position: relative;
}

.pw-field input {
  padding-right: 46px;
}

.pw-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pw-toggle:hover { color: var(--text); }

dl {
  font-size: 13px;
}

dt { color: var(--muted); margin-top: 10px; }
dd { margin: 2px 0 0; }
