:root{
  --bg:#1c484b;
  --card:#0b1220;
  --muted:#98a0b3;
  --good:#16a34a;
  --fair:#f59e0b;
  --weak:#ef4444;
  --very-weak:#ffffff;
  --glass: rgba(255,255,255,0.03);
  --accent:#60a5fa;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial;
  background: linear-gradient(180deg,var(--bg) 0%, #071129 100%);
  color:#e6eef8;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
}

.container{
  width:100%;
  max-width:1400px;
  background:linear-gradient(180deg,var(--card), rgba(11,18,32,0.85));
  border-radius:12px;
  padding:22px;
  box-shadow: 0 10px 50px rgba(2,6,23,0.6);
  border:1px solid rgba(255,255,255,0.03);
}

.layout{
  display:grid;
  grid-template-columns: auto 600px auto;
  gap:16px;
  grid-template-areas:
    "left center right-top"
    "left center right-bottom";
}

.panel.left{
  grid-area:left;
}

.panel.center{
  grid-area:center;
}

.panel.right-top{
  grid-area:right-top;
}

.panel.right-bottom{
  grid-area:right-bottom;
}

h1{margin:0 0 14px 0; font-size:20px; font-weight:600}
.label{display:block; color:var(--muted); margin-bottom:8px; font-size:13px}

.input-row{display:flex; gap:8px; margin-bottom:12px}
input[type="password"], input[type="text"]{
  flex:1;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.06);
  background:var(--glass);
  color:inherit;
  outline:none;
  font-size:15px;
}
input:focus{box-shadow:0 0 0 3px rgba(96,165,250,0.12); border-color:rgba(96,165,250,0.28)}

input.highlight-pulse{
  animation:highlight-pulse-animation 2s ease-in-out;
}

button#toggle{
  background:transparent;
  border:1px solid rgba(255,255,255,0.06);
  color:var(--muted);
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  font-weight:600;
}
button#toggle:active{transform:translateY(1px)}

.meter{height:12px; background:rgba(255,255,255,0.04); border-radius:8px; overflow:hidden; margin-bottom:10px}
.meter-bar{height:100%; width:4%; background:var(--very-weak); transition:width .25s ease, background .25s ease}

.strength-text{font-size:15px; color:#E6F5FF; margin-bottom:6px; font-weight:700}

.char-limit-error{font-size:13px; color:#ef4444; margin-bottom:10px; font-weight:600; display:none}

.crack-time{font-size:14px; color:var(--accent); margin-bottom:10px; font-weight:700}

.breach-check-btn{background:var(--accent); border:1px solid rgba(96,165,250,0.16); color:#072033; padding:10px 14px; border-radius:10px; cursor:pointer; font-weight:700; font-size:14px; margin-bottom:12px; transition:transform 0.12s ease, box-shadow .12s ease}
.breach-check-btn:hover:not(:disabled){transform:translateY(-1px); box-shadow:0 6px 20px rgba(96,165,250,0.12)}
.breach-check-btn:disabled{opacity:0.6; cursor:not-allowed; transform:none}

.checks{list-style:none; padding:0; margin:0 0 12px 0; display:grid; grid-template-columns:1fr 1fr; gap:8px}
.checks li{
  padding:8px 10px;
  border-radius:8px;
  font-size:13px;
  color:var(--muted);
  background:rgba(255,255,255,0.02);
  display:flex;
  align-items:center;
  gap:8px;
}
.checks li.passed{background:rgba(22,163,74,0.12); color:var(--good); font-weight:600; border:1px solid rgba(22,163,74,0.08)}
.checks li.failed{opacity:0.6}

.pwned-check{font-size:13px; padding:8px; border-radius:8px; background:rgba(255,255,255,0.02); margin-bottom:8px; min-height:20px; display:none}
.pwned-check.pwned{color:#ef4444; background:rgba(239,68,68,0.12); border:1px solid rgba(239,68,68,0.08)}
.pwned-check.safe{color:var(--good); background:rgba(22,163,74,0.12); border:1px solid rgba(22,163,74,0.08)}

.generated-text{font-size:13px; padding:8px; border-radius:8px; background:rgba(22,163,74,0.12); border:1px solid rgba(22,163,74,0.08); margin-top:8px; min-height:20px; display:none; color:var(--good)}

.loading-pwned{font-size:13px; color:var(--muted); opacity:0.6; display:none; margin-bottom:8px}

.generate-btn{background:var(--accent); border:1px solid rgba(96,165,250,0.16); color:#072033; padding:10px 14px; border-radius:10px; cursor:pointer; font-weight:700; font-size:14px; margin-bottom:12px; transition:transform 0.12s ease, box-shadow .12s ease}
.generate-btn:hover:not(:disabled){transform:translateY(-1px); box-shadow:0 6px 20px rgba(96,165,250,0.12)}
.generate-btn:disabled{opacity:0.6; cursor:not-allowed; transform:none}

.requirements-title{margin:8px 0 6px 0; font-size:13px; color:var(--muted); font-weight:600}

.panel{
  background:rgba(255,255,255,0.02);
  border:1px solid rgba(255,255,255,0.04);
  border-radius:8px;
  padding:12px;
}

.panel h3{margin:0 0 8px 0; font-size:13px; color:var(--muted); font-weight:600}

.panel.left,
.panel.right-top,
.panel.right-bottom{
  min-width:150px;
}

.small{
  margin:0; font-size:12px; color:var(--muted); line-height:1.4;
}

.small a{
  color:var(--accent); text-decoration:none;
}

.small a:hover{
  text-decoration:underline;
}

.policy-content{
  max-width:600px;
  margin:0 auto;
}

.policy-content h2{
  font-size:18px; margin:16px 0 12px 0; color:#E6F5FF; font-weight:600;
}

.policy-content h3{
  font-size:14px; margin:12px 0 8px 0; color:var(--accent); font-weight:600;
}

.policy-content p{
  font-size:14px; margin:0 0 12px 0; line-height:1.6; color:#c5cfe0;
}

.policy-content a{
  color:var(--accent); text-decoration:none;
}

.policy-content a:hover{
  text-decoration:underline;
}

.back-link{
  display:inline-block; margin-top:20px; padding:10px 14px; background:rgba(96,165,250,0.1); border:1px solid rgba(96,165,250,0.2); border-radius:8px; font-weight:600;
}

.back-link:hover{
  background:rgba(96,165,250,0.15); text-decoration:none;
}

@keyframes highlight-pulse-animation{
  0%{
    box-shadow:0 0 0 0 rgba(96,165,250,0.6);
    border-color:rgba(96,165,250,0.6);
  }
  50%{
    box-shadow:0 0 0 8px rgba(96,165,250,0.3);
    border-color:rgba(96,165,250,0.8);
  }
  100%{
    box-shadow:0 0 0 0 rgba(96,165,250,0);
    border-color:rgba(96,165,250,0.28);
  }
}

@media (max-width:768px){
  body{
    padding:16px;
  }
  
  .container{
    max-width:100%; padding:16px;
  }
  
  h1{
    font-size:18px;
  }
  
  .layout{
    grid-template-columns:1fr;
    grid-template-areas:
      "left"
      "center"
      "right-bottom"
      "right-top";
  }
  
  .panel.left,
  .panel.right-top,
  .panel.right-bottom{
    min-width:auto;
  }
  
  .checks{
    grid-template-columns:1fr;
  }
  
  .policy-content h2{
    font-size:16px;
  }
  
  .policy-content h3{
    font-size:13px;
  }
}

@media (max-width:480px){
  body{
    padding:12px;
  }
  
  .container{
    padding:12px;
  }
  
  h1{
    font-size:16px; margin-bottom:10px;
  }
  
  .panel{
    padding:10px;
  }
  
  .panel h3{
    font-size:12px;
  }
  
  .input-row{
    gap:4px; margin-bottom:10px;
  }
  
  input[type="password"], input[type="text"]{
    font-size:14px; padding:8px 10px;
  }
  
  button{
    font-size:12px;
  }
  
  .breach-check-btn, .generate-btn{
    padding:8px 10px; font-size:12px;
  }
  
  .label{
    font-size:12px;
  }
  
  .strength-text, .crack-time{
    font-size:13px;
  }
  
  .checks li{
    font-size:12px; padding:6px 8px; gap:6px;
  }
  
  .small{
    font-size:11px;
  }
  
  .policy-content h2{
    font-size:14px; margin:12px 0 8px 0;
  }
  
  .policy-content h3{
    font-size:12px;
  }
  
  .policy-content p{
    font-size:13px;
  }
}

.top-toast{
  position:fixed;
  top:16px;
  left:50%;
  transform:translateX(-50%) translateY(-10px);
  background: linear-gradient(90deg, rgba(96,165,250,0.75), rgba(96,165,250,0.50));
  color:#072033;
  padding:12px 16px;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(2,6,23,0.6);
  border:1px solid rgba(96,165,250,0.18);
  z-index:9999;
  opacity: 0;
  pointer-events:none;
  transition:opacity .28s ease, transform .28s ease;
  min-width:260px;
}
.top-toast.show{ transform:translateX(-50%) translateY(0); opacity:1; pointer-events:auto }
.top-toast .top-toast-content{ display:flex; align-items:center; justify-content:space-between; gap:12px }
.top-toast .top-toast-message{ color:#ffffff; font-weight:700; margin-right:8px }
.top-toast .top-toast-actions{ display:flex; gap:8px; align-items:center }
.top-toast .top-toast-btn{ background:rgba(255,255,255,1); border:1px solid rgba(255,255,255,1); color:var(--accent); padding:8px 10px; border-radius:8px; cursor:pointer; font-weight:700 }
.top-toast .top-toast-btn:disabled{ opacity:0.6; cursor:not-allowed }
.top-toast .top-toast-close{ background:transparent; border:none; font-size:18px; line-height:1; color:#cfeaff; cursor:pointer; padding:4px 6px; border-radius:6px }

@media (max-width:520px){
  .top-toast{ left:12px; right:12px; transform:none; width:calc(100% - 24px); }
  .top-toast.show{ transform:translateY(0); }
}

@media (max-width:420px){
  .top-toast{ top:8px; padding:10px 12px; border-radius:10px; }
  .top-toast .top-toast-message{ font-size:14px }
  .top-toast .top-toast-btn{ padding:6px 8px; font-size:13px }
}
