:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1c1f26;
  --muted: #6b7280;
  --border: #e2e4e9;
  --accent: #2f6fed;
  --accent-contrast: #ffffff;
  --danger: #d64545;
  --warning: #d99b1f;
  --success: #2f9e59;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 4px 24px rgba(20, 20, 30, 0.06);
}

.loading {
  color: var(--muted);
  text-align: center;
}

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

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
  line-height: 1.4;
}

.subtitle strong {
  color: var(--text);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 16px;
}

input[type='password'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fafafa;
}

input[type='password']:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: #fff;
}

.strength-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  margin-top: 10px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--danger);
  transition:
    width 0.15s ease,
    background-color 0.15s ease;
}

.strength-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}

.match-indicator {
  font-size: 0.8rem;
  margin-top: 6px;
  min-height: 1.1em;
}

.match-indicator.match {
  color: var(--success);
}

.match-indicator.mismatch {
  color: var(--danger);
}

button[type='submit'] {
  width: 100%;
  margin-top: 24px;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button[type='submit']:disabled {
  background: #b7c6ef;
  cursor: not-allowed;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 14px;
  min-height: 1.1em;
}

.state-panel {
  text-align: center;
}

.state-panel .icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.state-panel.success .icon {
  color: var(--success);
}

.state-panel.error .icon {
  color: var(--danger);
}

.state-panel p {
  color: var(--muted);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14161c;
    --card-bg: #1c1f27;
    --text: #f2f3f5;
    --muted: #9aa0ac;
    --border: #2c2f38;
  }

  input[type='password'] {
    background: #14161c;
    color: var(--text);
  }

  input[type='password']:focus {
    background: #1c1f27;
  }
}
