:root {
  --bg: #f3f5f9;
  --card-radius: 1.1rem;
  --brand-1: #4f46e5;
  --brand-2: #7c3aed;
  --ink: #1e2433;
}

* { box-sizing: border-box; }

body {
  background: radial-gradient(1200px 500px at 20% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, #fae8ff 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #111827; color: #fff; padding: .6rem 1rem; z-index: 9999; border-radius: 0 0 .6rem 0;
}
.skip-link:focus { left: 0; color: #fff; }

.app-header .brand-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.6rem;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 10px 24px rgba(79,70,229,.35);
}
.brand-title { font-weight: 800; letter-spacing: -.02em; }
.brand-subtitle { color: #5b6478; }

.local-badge {
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
  font-size: .82rem; font-weight: 600; padding: .45rem .8rem; border-radius: 999px;
}

.card { border: 0; border-radius: var(--card-radius); }
.generator-card, .card.shadow-sm { box-shadow: 0 12px 32px rgba(30,36,51,.08) !important; }

.secure-note {
  background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3;
  border-radius: .8rem; padding: .6rem .9rem; font-size: .9rem;
}

.password-display {
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 1rem;
}
.password-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem; letter-spacing: .02em;
  border: 0; background: transparent; padding: .7rem .8rem;
  overflow-x: auto; text-overflow: ellipsis;
}
.password-field:focus { background: #fff; box-shadow: 0 0 0 .25rem rgba(79,70,229,.18); border-radius: .6rem; }
.password-field.password-hidden { letter-spacing: .35em; font-weight: 700; }

.btn-icon {
  width: 44px; height: 44px; border-radius: .8rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0; background: #fff; color: #334155; font-size: 1.1rem;
}
.btn-icon:hover { background: #eef2ff; border-color: #c7d2fe; color: var(--brand-1); }
.btn-icon:focus-visible { outline: 3px solid rgba(79,70,229,.45); outline-offset: 2px; }

.copy-feedback { color: #15803d; font-weight: 700; min-height: 1.2em; }

.strength-track { height: 12px; border-radius: 999px; background: #e9edf3; overflow: hidden; }
.strength-track .progress-bar { border-radius: 999px; transition: width .25s ease; background: #22c55e; }
.strength-badge { font-size: .85rem; padding: .4em .8em; border-radius: 999px; font-weight: 700; }
.badge-weak { background: #fee2e2; color: #991b1b; }
.badge-fair { background: #fef3c7; color: #92400e; }
.badge-strong { background: #dcfce7; color: #166534; }
.badge-very-strong { background: #4f46e5; color: #fff; }

.entropy-text { font-size: .92rem; }
.length-value {
  min-width: 3.2rem; text-align: center; font-weight: 800; font-size: 1.15rem;
  background: #eef2ff; color: #3730a3; border-radius: .7rem; padding: .15rem .6rem;
}
.custom-range { height: 1.8rem; }
.preset-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.char-option { background: #f8fafc; border: 1px solid #e6eaf1; border-radius: .8rem; padding: .6rem .7rem; height: 100%; }
.char-hint { display: block; font-size: .75rem; color: #6b7280; font-family: ui-monospace, monospace; }
.form-check-input:focus { box-shadow: 0 0 0 .25rem rgba(79,70,229,.2); border-color: var(--brand-1); }
.form-check-input:checked { background-color: var(--brand-1); border-color: var(--brand-1); }

.pattern-box { background: #f8fafc; border: 1px dashed #c7d2fe; border-radius: .9rem; padding: 1rem; }
.font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.generate-btn {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border: 0; border-radius: .9rem; padding: .9rem; font-weight: 700;
  box-shadow: 0 12px 24px rgba(79,70,229,.35);
}
.generate-btn:hover { filter: brightness(1.05); }
.generate-btn:focus-visible { outline: 3px solid rgba(79,70,229,.5); outline-offset: 3px; }

.app-footer { border-top: 1px solid #e5e7eb; background: rgba(255,255,255,.7); }
code { color: #6d28d9; }

@media (max-width: 576px) {
  .password-field { font-size: 1rem; }
  .btn-icon { width: 42px; height: 42px; }
  .brand-subtitle { font-size: .9rem; }
}
