:root {
  --bg: #0f172a;
  --card: #111827;
  --card-border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --weak: #ef4444;
  --medium: #f59e0b;
  --strong: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #1e293b, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.card {
  width: min(100%, 600px);
  background: color-mix(in oklab, var(--card) 90%, black);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}

.card-header h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.card-header p {
  margin-top: 0.45rem;
  color: var(--muted);
}

.password-output {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.5rem;
}

#password {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  padding: 0.45rem;
}

#password::placeholder {
  color: #6b7280;
}

.output-actions {
  display: flex;
  gap: 0.45rem;
}

.icon-button {
  border: 1px solid #334155;
  background: #111827;
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.copy-message {
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
  color: var(--strong);
  font-size: 0.92rem;
}

.control-group {
  margin-top: 1rem;
}

.length-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

#length {
  width: 100%;
  margin-top: 0.5rem;
  accent-color: var(--accent);
}

.options {
  margin-top: 1rem;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.options legend {
  color: var(--muted);
  padding: 0 0.4rem;
}

.options label {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.primary-button {
  width: 100%;
  margin-top: 1rem;
  border: none;
  border-radius: 12px;
  padding: 0.9rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.analysis {
  margin-top: 1.25rem;
  background: #0b1220;
  border: 1px solid #233047;
  border-radius: 12px;
  padding: 0.9rem;
}

.strength-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strength-header h2 {
  margin: 0;
  font-size: 1rem;
}

.strength-text {
  font-weight: 700;
}

.strength-bar-track {
  margin-top: 0.65rem;
  width: 100%;
  height: 10px;
  background: #1f2937;
  border-radius: 100px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  border-radius: inherit;
  transition: width 260ms ease, background-color 260ms ease;
}

.weak {
  color: var(--weak);
  background-color: var(--weak);
}

.medium {
  color: var(--medium);
  background-color: var(--medium);
}

.strong {
  color: var(--strong);
  background-color: var(--strong);
}

.crack-time {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.crack-time .value {
  color: var(--text);
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .card {
    padding: 1rem;
  }

  .password-output {
    flex-wrap: wrap;
  }

  #password {
    width: 100%;
  }

  .output-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
