/* style.css — Namespaced, polished dark design for the password generator */
.pwgen {
  --pw-bg-1: #0a0f16;
  --pw-bg-2: #0f1722;
  --pw-glow-1: #1d2a44;
  --pw-glow-2: #38205c;
  --pw-surface: rgba(17, 22, 28, 0.65);
  --pw-surface-strong: rgba(17, 22, 28, 0.85);
  --pw-border: rgba(88, 110, 142, 0.25);
  --pw-text: #e6edf7;
  --pw-muted: #9fb1c3;
  --pw-accent: #4da3ff;
  --pw-accent-2: #72e5ff;
  --pw-danger: #ff6b6b;

  position: relative;
  isolation: isolate;
  min-height: 100svh;
  padding: 48px 16px;
  color: var(--pw-text);
  width: 100%;
  background-color: var(--pw-bg-2);
}
.pwgen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 10% -10%, var(--pw-glow-1) 0%, transparent 60%),
    radial-gradient(900px 700px at 110% 10%, var(--pw-glow-2) 0%, transparent 55%),
    linear-gradient(180deg, var(--pw-bg-1), var(--pw-bg-2) 60%, var(--pw-bg-1));
}

.pwgen * { box-sizing: border-box; }
.pwgen code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.pwgen .pwgen-container { max-width: 1100px; margin: 0 auto; }

.pwgen .pwgen-title { margin: 0 0 16px; font-size: clamp(20px, 3vw, 30px); letter-spacing: .2px; }
.pwgen .pwgen-card {
  background: var(--pw-surface);
  border: 1px solid var(--pw-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}
@supports not ((backdrop-filter: blur(8px))) {
  .pwgen .pwgen-card { background: var(--pw-surface-strong); }
}

.pwgen .pwgen-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pwgen .pwgen-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.pwgen .pwgen-label { display: block; margin-bottom: 6px; font-weight: 600; }
.pwgen .pwgen-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--pw-border);
  background: rgba(12, 18, 25, .75); color: var(--pw-text); border-radius: 12px; font-size: 16px;
  outline: none; transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.pwgen .pwgen-input:focus-visible {
  border-color: color-mix(in oklab, var(--pw-accent) 70%, white);
  box-shadow: 0 0 0 3px rgba(77,163,255,.22);
  background: rgba(12, 18, 25, .92);
}
.pwgen .pwgen-help { color: var(--pw-muted); font-size: 13px; }
.pwgen .pwgen-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.pwgen .pwgen-checkbox {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--pw-border); background: rgba(12, 18, 25, .6); border-radius: 12px; user-select: none;
}

.pwgen .pwgen-spacer { height: 10px; }
.pwgen .pwgen-hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); margin: 18px 0; }

.pwgen .pwgen-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-start; }
.pwgen .pwgen-button {
  appearance: none; background: linear-gradient(180deg, #2b7bff, #255ed1); border: none; color: white;
  padding: 12px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; letter-spacing: .2px;
  transition: transform .06s ease, filter .15s ease, box-shadow .15s ease; box-shadow: 0 8px 24px rgba(43,123,255,.25);
}
.pwgen .pwgen-button:hover { filter: brightness(1.05); }
.pwgen .pwgen-button:active { transform: translateY(1px); }

.pwgen .pwgen-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.pwgen .pwgen-table th, .pwgen .pwgen-table td { padding: 12px 14px; }
.pwgen .pwgen-table tr { background: rgba(13, 20, 27, .85); border: 1px solid var(--pw-border); }
.pwgen .pwgen-table tr td:first-child { border-radius: 12px 0 0 12px; }
.pwgen .pwgen-table tr td:last-child { border-radius: 0 12px 12px 0; }
.pwgen .pwgen-copybtn {
  border-radius: 10px; background: rgba(12, 18, 25, .7); border: 1px solid var(--pw-border); color: #cfe1f7;
  padding: 10px 12px; cursor: pointer; transition: filter .15s ease, transform .06s ease;
}
.pwgen .pwgen-copybtn:hover { filter: brightness(1.05); }
.pwgen .pwgen-copybtn:active { transform: translateY(1px); }
.pwgen .pwgen-nowrap { width: 1%; white-space: nowrap; }

.pwgen .pwgen-error { background: rgba(57,18,18,.75); border-color: rgba(204,83,83,.65); }
.pwgen .pwgen-footer{ color:#9ab; opacity:.9; margin-top: 12px; font-size: 13px; }

/* Disabled state visuals */
.pwgen input:disabled{ opacity:.55; cursor:not-allowed; }
.pwgen .pwgen-disabled{ opacity:.6; }

@media (prefers-reduced-motion: no-preference) {
  .pwgen .pwgen-card { animation: pwgen-fade .35s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes pwgen-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}


/* Section subtitles */
.pwgen .pwgen-section-subtitle {
  font-weight: 700;
  font-size: 14px;
  color: #c7d6ea;
  margin: 2px 0 8px;
  letter-spacing: .2px;
}

/* Stepper layout */
.pwgen .pwgen-stepper{
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(100px, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
}
.pwgen .pwgen-stepper .pwgen-input[type="number"],
.pwgen input[type="number"].pwgen-input {
  height: 48px;
  font-size: 16px;
  padding: 10px 12px;
}
.pwgen .pwgen-step{ appearance:none; border:1px solid var(--pw-border); background:rgba(12,18,25,.7); color:var(--pw-text); border-radius:12px; font-size:22px; line-height:1; cursor:pointer; transition:transform .06s ease, filter .15s ease, box-shadow .15s ease; box-shadow:0 4px 14px rgba(0,0,0,.2);
  line-height: 1;
  cursor: pointer;
  transition: transform .06s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.pwgen .pwgen-step:hover { filter: brightness(1.06); }
.pwgen .pwgen-step.is-active { transform: translateY(1px); }
.pwgen .pwgen-step:disabled { opacity: .45; cursor: not-allowed; }

/* Improve grid spacing for readability */
.pwgen .pwgen-grid { gap: 22px; }
.pwgen .pwgen-card { padding: 22px; }

/* Larger viewports: airy column ratios */
@media (min-width: 1080px) {
  .pwgen .pwgen-grid { grid-template-columns: 1fr 1.2fr 1fr; }
}

.pwgen input[type="number"]{ font-variant-numeric: tabular-nums; }

/* Clear, table-like alignment for class min/max */
.pwgen .pwgen-paramtable{ width:100%; border-collapse:separate; border-spacing:0 10px; table-layout:fixed; min-width:680px;
}
.pwgen .pwgen-paramtable thead th {
  text-align: left;
  font-weight: 700;
  padding: 8px 10px;
  color: #c7d6ea;
}
.pwgen .pwgen-paramtable tbody tr {
  background: rgba(13, 20, 27, .85);
  border: 1px solid var(--pw-border);
}
.pwgen .pwgen-paramtable tbody th,
.pwgen .pwgen-paramtable tbody td {
  padding: 10px;
  vertical-align: middle;
}
.pwgen .pwgen-paramtable tbody th { width: 180px; }

/* Make min/max cells roomy */
.pwgen .pwgen-paramtable input[type="number"].pwgen-input{
  width: 100%;
  max-width: 220px;
  min-width: 140px;
  height: 46px;
  font-size: 16px;
}

/* Let table scroll horizontally on narrow screens to keep inputs wide */
.pwgen .pwgen-paramtable{ display: block; overflow-x: auto; }
.pwgen .pwgen-paramtable table{ width: 100%; }

/* Stepper min width inside table cells */
.pwgen .pwgen-stepper{
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(100px, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
}
.pwgen .pwgen-step{ appearance:none; border:1px solid var(--pw-border); background:rgba(12,18,25,.7); color:var(--pw-text); border-radius:12px; font-size:22px; line-height:1; cursor:pointer; transition:transform .06s ease, filter .15s ease, box-shadow .15s ease; box-shadow:0 4px 14px rgba(0,0,0,.2); }

/* Global grid tweak for overall balance */
.pwgen .pwgen-grid{ grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 26px; }


/* Wide table for class min/max */
.pwgen .pwgen-tablewrap{ width:100%; overflow-x:auto; }
.pwgen .pwgen-paramtable{ width:100%; border-collapse:separate; border-spacing:0 10px; table-layout:fixed; min-width:680px;
}
.pwgen .pwgen-paramtable thead th{
  text-align: left;
  font-weight: 700;
  padding: 8px 10px;
  color: #c7d6ea;
}
.pwgen .pwgen-paramtable tbody tr{
  background: rgba(13, 20, 27, .85);
  border: 1px solid var(--pw-border);
}
.pwgen .pwgen-paramtable tbody th,
.pwgen .pwgen-paramtable tbody td{
  padding: 10px;
  vertical-align: middle;
}
.pwgen .pwgen-paramtable tbody th{ width: 200px; }

.pwgen .pwgen-paramtable input[type="number"].pwgen-input{
  width: 100%;
  max-width: 220px;
  min-width: 140px;
  height: 46px;
  font-size: 16px;
}
/* Stepper in table cells */
.pwgen .pwgen-stepper{
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(100px, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
}
.pwgen .pwgen-step{ appearance:none; border:1px solid var(--pw-border); background:rgba(12,18,25,.7); color:var(--pw-text); border-radius:12px; font-size:22px; line-height:1; cursor:pointer; transition:transform .06s ease, filter .15s ease, box-shadow .15s ease; box-shadow:0 4px 14px rgba(0,0,0,.2); }

@media (max-width: 880px){
  .pwgen .pwgen-paramtable{ min-width: 560px; }
  .pwgen .pwgen-paramtable input[type="number"].pwgen-input{ max-width: 180px; min-width: 120px; height: 44px; font-size: 15px; }
  .pwgen .pwgen-stepper{ grid-template-columns: 36px minmax(90px,1fr) 36px; gap: 6px; }
  .pwgen .pwgen-step{ font-size: 20px; }
}


/* --- Compact class cards layout --- */
.pwgen .pwgen-classes{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.pwgen .pwgen-classcard{
  background: rgba(13, 20, 27, .85);
  border: 1px solid var(--pw-border);
  border-radius: 12px;
  padding: 12px;
}
.pwgen .pwgen-classname{ font-weight:700; margin-bottom: 8px; }
.pwgen .pwgen-classfields{
  display:grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 8px;
  align-items:center;
}
.pwgen .pwgen-classfields label{ color: var(--pw-muted); font-size: 13px; }

/* Hide native number spinners (we use custom ± buttons) */
.pwgen input[type="number"]{-moz-appearance: textfield; appearance: textfield;}
.pwgen input[type="number"]::-webkit-outer-spin-button,
.pwgen input[type="number"]::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }

/* Compact stepper + input inside cards */
.pwgen .pwgen-stepper{ grid-template-columns: 34px 1fr 34px; gap: 6px; }
.pwgen input[type="number"].pwgen-input{ height: 40px; font-size: 15px; min-width: 0; }
.pwgen .pwgen-step{ font-size: 20px; }

@media (max-width: 880px){
  .pwgen .pwgen-classes{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px){
  .pwgen .pwgen-classes{ grid-template-columns: 1fr; }
}
