:root{
  --bg:#0f1724;
  --card:#0b1220;
  --accent:#7dd3fc;
  --text:#e6eef8;
  --muted:#9fb3c8;
  --glass: rgba(255,255,255,0.03);
  --accent-dark: #03606d;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:linear-gradient(180deg,#071028,#081524);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:30px;
}

.container{
  width:100%;
  max-width:720px;
  margin:0 auto;
  padding:28px;
  background:var(--glass);
  border-radius:14px;
  box-shadow:0 8px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.03);
}

h1{
  text-align:center;
  margin:0 0 18px 0;
  font-size:1.6rem;
  letter-spacing:0.2px;
}

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

.row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.spacer { flex: 1 1 auto; }

.password-row {
  display:flex;
  gap:10px;
  width:100%;
}

.password{
  flex:1 1 auto;
  padding:12px;
  border-radius:10px;
  background:#06131f;
  border:1px solid rgba(255,255,255,0.06);
  font-size:1rem;
  font-family: monospace;
  color:var(--text);
  transition: box-shadow .15s ease, outline .15s ease;
}

.password:focus {
  outline: 2px solid rgba(125,211,252,0.18);
  box-shadow: 0 0 14px rgba(125,211,252,0.08);
}

button{
  padding:10px 14px;
  border:none;
  background:var(--accent);
  color:#03303c;
  border-radius:9px;
  font-weight:700;
  cursor:pointer;
  transition: transform .12s ease, opacity .12s ease;
  box-shadow: 0 6px 18px rgba(7,21,33,0.35), inset 0 -2px 0 rgba(0,0,0,0.05);
}

button:hover:not([disabled]){
  opacity:0.95;
  transform: translateY(-2px);
}

button:active:not([disabled]){
  transform: translateY(0);
}

button[disabled]{
  opacity:0.4;
  cursor:not-allowed;
  transform: none;
}

fieldset{
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  padding:12px;
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

legend{ font-weight:700; padding:0 6px; }

meter{
  width:100%;
  height:14px;
  appearance: none;
  -webkit-appearance: none;
  border-radius:8px;
  overflow:hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.02);
}

/* WebKit meter styling */
meter::-webkit-meter-bar {
  background: rgba(255,255,255,0.04);
}
meter::-webkit-meter-optimum-value {
  background: var(--accent);
}
meter::-webkit-meter-suboptimum-value {
  background: #f59e0b;
}
meter::-webkit-meter-even-less-good-value {
  background: #ef4444;
}

/* Use data-level attribute to color it */
meter[data-level="0"]::-webkit-meter-optimum-value { background: #ef4444; }
meter[data-level="1"]::-webkit-meter-optimum-value { background: #f97316; }
meter[data-level="2"]::-webkit-meter-optimum-value { background: #f59e0b; }
meter[data-level="3"]::-webkit-meter-optimum-value { background: var(--accent); }
meter[data-level="4"]::-webkit-meter-optimum-value { background: #10b981; }

/* Firefox fallback */
meter::-moz-meter-bar {
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
}

/* Label text */
.strength-text{
  min-width:120px;
  text-align:right;
  color:var(--muted);
  font-weight:600;
}

.entropy-text{
  color:var(--muted);
  font-size:0.9rem;
  margin-left:2px;
}

/* Footer */
footer{
  margin-top:20px;
  text-align:center;
  font-size:0.8rem;
  color:var(--muted);
}

/* Responsive tweaks */
@media (max-width:520px){
  .strength-text { min-width: 100px; font-size: 0.9rem; }
  .container { padding:18px; margin:10px; }
  button { padding:9px 12px; }
}

/* Copy animation */
@keyframes copyPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(125,211,252,0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(125,211,252,0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(125,211,252,0.0);
  }
}

.copy-animate {
  animation: copyPulse 0.35s ease-out;
}

/* Flying checkmark animation */
.checkmark-fly {
  position: absolute;
  font-size: 1.2rem;
  pointer-events: none;
  animation: flyUp 0.9s ease-out forwards;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(125,211,252,0.8);
  z-index: 999;
}

@keyframes flyUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  70% {
    opacity: 0.9;
    transform: translateY(-25px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-45px) scale(0.9);
  }
}

/* Ensure the button container can position animations */
.buttons {
  position: relative;
}
