/* Modern, sleek UI — white background with very light blue fade */
:root{
  --bg:#ffffff;
  --bg-fade:#f6fbff;
  --ink:#0f172a;          /* slate-900 */
  --muted:#667085;        /* gray-500 */
  --brand:#2563eb;        /* blue-600 */
  --brand-2:#60a5fa;      /* blue-400 */
  --ring:rgba(37,99,235,.35);
  --card:#fffffffa;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08), 0 2px 10px rgba(16,24,40,.06);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color:var(--ink);
  background: radial-gradient(1200px 800px at 20% -10%, var(--bg-fade) 0%, transparent 40%),
              radial-gradient(900px 700px at 90% 10%, var(--bg-fade) 0%, transparent 50%),
              linear-gradient(180deg, var(--bg), var(--bg));
  overflow-x:hidden;
}

/* Animated soft blobs */
.bg-blob{
  position:fixed; inset:auto; width:520px; height:520px;
  filter: blur(70px); opacity:.35; z-index:-1; pointer-events:none;
  background: radial-gradient(circle at 30% 30%, var(--brand-2), transparent 60%),
              radial-gradient(circle at 70% 70%, var(--brand), transparent 60%);
  mix-blend-mode: multiply; border-radius:50%;
  animation: float 16s ease-in-out infinite;
}
.blob-1{ top:-120px; left:-120px; animation-delay:0s;}
.blob-2{ bottom:-160px; right:-160px; animation-delay:3s;}
@keyframes float{
  0%,100%{ transform: translateY(0) translateX(0) scale(1); }
  50%{ transform: translateY(30px) translateX(-15px) scale(1.05); }
}

.wrap{
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.topbar{
  text-align:center;
  margin-bottom: 20px;
}
.logo{
  font-size:32px;
  display:inline-grid;
  place-items:center;
  width:56px; height:56px;
  border-radius:16px;
  background:linear-gradient(135deg, var(--brand), var(--brand-2));
  color:white; margin:0 auto 10px;
  box-shadow: var(--shadow);
}
h1{
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing:-.02em;
  margin: 6px 0 6px;
}
.subtitle{
  color:var(--muted);
  margin:0;
}

/* Card */
.card{
  margin: 26px auto 0;
  background: var(--card);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(120%) blur(4px);
  border: 1px solid rgba(99, 102, 241, 0.08);
}

.display-row{
  display:flex; gap:12px; align-items:center;
  margin-bottom: 14px;
}
.password-output{
  flex:1;
  padding: 14px 14px;
  font-size: 18px;
  border-radius: 14px;
  border:1px solid #e5e7eb;
  background:#fff;
  outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.password-output:focus{
  border-color: var(--brand);
  box-shadow: 0 0 0 6px var(--ring);
}

.controls{ display:grid; gap:18px; }

.control label{
  font-weight:600; display:flex; align-items:center; gap:8px;
}
#lengthRange{
  width:100%; accent-color: var(--brand);
}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap:10px;
}
.toggle{
  display:flex; gap:10px; align-items:center;
  padding:10px 12px; border:1px solid #e5e7eb; border-radius:12px; background:#fff;
  transition: border-color .2s, transform .2s;
}
.toggle:hover{ border-color:#c7d2fe; transform: translateY(-1px); }
.toggle input{ accent-color: var(--brand); }

.strength{
  display:grid; gap:8px; align-items:center;
  grid-template-columns: auto 1fr auto;
  color:var(--muted);
}
.meter{
  height:10px; background:#eef2ff; border-radius:999px; overflow:hidden;
  border:1px solid #e5e7eb;
}
.fill{
  height:100%; width:0%; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
  transition: width .35s ease;
}
.label{ font-weight:700; color:var(--ink); }

.actions{ display:flex; justify-content:center; }
.btn{
  border:1px solid transparent;
  background:#fff;
  padding:12px 16px; border-radius:12px;
  font-weight:700; cursor:pointer;
  transition: transform .15s ease, box-shadow .2s, background .2s, border-color .2s;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn.primary{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color:#fff; border:none;
  box-shadow: 0 10px 18px rgba(37, 99, 235, .25);
}
.btn.ghost{
  border-color:#e5e7eb; background:#fff;
}

/* Footer */
.footer{
  text-align:center; color:var(--muted); margin-top:16px;
}

/* Modal */
dialog::backdrop{ background: rgba(15, 23, 42, .35); backdrop-filter: blur(3px); }
dialog{
  border:none; padding:0; background:transparent;
}
.modal-card{
  padding:22px; background:#fff; border-radius:16px; min-width: 320px;
  box-shadow: var(--shadow);
  display:grid; gap:12px;
}
.modal-inputs{
  display:flex; gap:10px; align-items:center;
}
.modal-inputs input{
  flex:1; padding:12px; border-radius:10px; border:1px solid #e5e7eb; outline:none;
}
.btn.small{ padding:8px 12px; font-weight:600; }

@media (max-width:520px){
  .grid{ grid-template-columns: 1fr; }
  .display-row{ flex-direction: column; align-items: stretch; }
  .btn.ghost{ width:100%; }
}


/* Pulse effect for output */
.password-output.pulse{
  box-shadow: 0 0 0 6px var(--ring), inset 0 0 0 1px var(--brand);
  transition: box-shadow .35s ease;
}

/* Toast */
.toast{
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background:#0f172a; color:#fff; padding:10px 14px; border-radius:12px;
  opacity:0; pointer-events:none; box-shadow: var(--shadow);
}
.toast.show{
  opacity:1; transform: translateX(-50%) translateY(0);
  transition: opacity .25s ease, transform .25s ease;
}
