/* ─── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #0f172a;
  --card-bg:     #1e293b;
  --border:      #334155;
  --border-soft: #1e3a5f;
  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --accent:      #06b6d4;
  --accent-dim:  #0e7490;
  --success:     #10b981;
  --red:         #ef4444;
  --orange:      #f97316;
  --yellow:      #eab308;
  --green:       #22c55e;
  --cyan:        #06b6d4;
  --radius:      14px;
  --radius-sm:   8px;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ─── Page Layout ─────────────────────────────────────────────────── */
.page {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Header ──────────────────────────────────────────────────────── */
.header {
  text-align: center;
}

.logo {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ─── Card ────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
}

/* ─── Password Row ────────────────────────────────────────────────── */
.password-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.password-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(6, 182, 212, 0.08);
}

.copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.copy-btn .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ─── Strength Section ────────────────────────────────────────────── */
.strength-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.strength-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.strength-bar {
  flex: 1;
  display: flex;
  gap: 5px;
  height: 6px;
}

.segment {
  flex: 1;
  border-radius: 99px;
  background: var(--border);
  transition: background-color 0.35s ease;
}

.strength-label {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 72px;
  text-align: right;
  color: var(--text-muted);
  transition: color 0.3s;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.crack-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.crack-icon {
  font-size: 0.85rem;
}

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

/* ─── Divider ─────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ─── Control Groups ──────────────────────────────────────────────── */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.control-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.control-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
  text-align: right;
}

/* ─── Slider ──────────────────────────────────────────────────────── */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--accent);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.3);
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--accent);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 1px;
}

/* ─── Checkboxes ──────────────────────────────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.checkbox-label:hover {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.05);
}

/* Hide native checkbox */
.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom checkbox */
.checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  position: relative;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: 2px solid #0f172a;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.checkbox-label input:disabled + .checkbox-custom {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.charset-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.charset-example {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Courier New', Courier, monospace;
}

/* ─── Generate Button ─────────────────────────────────────────────── */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 18px rgba(6, 182, 212, 0.28);
}

.generate-btn:hover {
  opacity: 0.92;
  box-shadow: 0 4px 24px rgba(6, 182, 212, 0.4);
}

.generate-btn:active {
  transform: scale(0.98);
}

.generate-btn .icon {
  width: 16px;
  height: 16px;
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .card {
    padding: 20px 16px;
  }

  .logo {
    font-size: 2rem;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}
