:root {
  --color-bg: #cdced5;
  --color-card: #ffffff;
  --color-text: #1f2733;
  --color-muted: #667085;
  --color-border: #e2e5ea;
  --color-accent: #4f46e5;
  --color-0: #d32f2f;
  --color-1: #f57c00;
  --color-2: #fbc02d;
  --color-3: #7cb342;
  --color-4: #388e3c;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  margin: 0;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.card {
  width: 100%;
  max-width: 840px;
  background: var(--color-card);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 32px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6em;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--color-muted);
  font-size: 0.95em;
  line-height: 1.5;
}

.password-input-group {
  margin: 0 0 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9em;
}

.input-wrapper {
  position: relative;
}

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 44px 12px 14px;
  font-size: 1em;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: #fff;
}

.toggle-visibility {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  padding: 8px;
  font-size: 0.85em;
  border-radius: 6px;
}

.toggle-visibility:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.loading-spinner[hidden] {
  display: none;
}

.loading-spinner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--color-muted);
  font-size: 0.9em;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.strength-bar {
  width: 100%;
  height: 8px;
  background-color: var(--color-border);
  margin-top: 12px;
  border-radius: 4px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-fill.score-0 { background-color: var(--color-0); width: 20%; }
.strength-fill.score-1 { background-color: var(--color-1); width: 40%; }
.strength-fill.score-2 { background-color: var(--color-2); width: 60%; }
.strength-fill.score-3 { background-color: var(--color-3); width: 80%; }
.strength-fill.score-4 { background-color: var(--color-4); width: 100%; }

.score-label-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.score-label {
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 1.2em;
  line-height: 1.2em;
}

.score-label.score-0 { color: var(--color-0); }
.score-label.score-1 { color: var(--color-1); }
.score-label.score-2 { color: #b8860b; }
.score-label.score-3 { color: var(--color-3); }
.score-label.score-4 { color: var(--color-4); }

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f8fa;
  font-size: 0.9em;
  line-height: 1.5;
  min-height: 0;
}

.feedback:empty {
  display: none;
}

.warning {
  color: var(--color-0);
  font-weight: 600;
  font-size:110%;
  margin-bottom: 4px;
}

.suggestions {
  color: var(--color-text);
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.suggestions li {
  margin-bottom: 4px;
  padding-left: 1.6em;
  position: relative;
}

.suggestions li::before {
  content: "!";
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.1em;
  height: 1.1em;
  line-height: 1.1em;
  border-radius: 50%;
  background: var(--color-0);
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  text-align: center;
}

.suggestions li:last-child {
  margin-bottom: 0;
}

.disclaimer {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fffaeb;
  border: 1px solid #fde68a;
  color: var(--color-text);
  font-size: 0.85em;
  line-height: 1.5;
}

.disclaimer p {
  margin: 0 0 8px;
  font-weight: 600;
}

.disclaimer ul {
  margin: 0;
  padding-left: 1.2em;
}

.disclaimer li {
  margin-bottom: 4px;
}

.disclaimer li:last-child {
  margin-bottom: 0;
}

.crack-time {
  margin-top: 12px;
  font-size: 0.9em;
  color: var(--color-text);
}

.crack-time-info-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
}

.crack-time-info-link:hover {
  text-decoration: underline;
}

.hashing-toggle {
  margin-top: 20px;
  padding-top: 16px;
  /*border-top: 1px solid var(--color-border);*/
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hashing-toggle-label {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--color-muted);
}

.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-option {
  font-size: 0.85em;
  color: var(--color-muted);
  transition: color 0.2s, font-weight 0.2s;
}

.toggle-option.active {
  color: var(--color-text);
  font-weight: 700;
}

.toggle-switch {
  position: relative;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: var(--color-3);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.toggle-switch.checked {
  background: var(--color-0);
}

.toggle-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.toggle-switch.checked .toggle-switch-knob {
  transform: translateX(22px);
}

.hashing-toggle-description {
  margin: 10px 0 0;
  font-size: 0.85em;
  color: var(--color-muted);
  line-height: 1.5;
}

.info-card {
  color: var(--color-muted);
  font-size: 0.9em;
  line-height: 1.6;
}

.info-card h2 {
  margin: 0 0 12px;
  font-size: 1.1em;
  color: var(--color-text);
}

.info-card p {
  margin: 0 0 12px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.info-card a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.info-card a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  body {
    background: var(--color-card);
    padding: 20px 12px;
  }

  .card {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .card + .card {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
  }
}
