/* Distantec passgen page styles. Extracted from index.html for caching and CSP readiness. */
:root {
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #8b5cf6;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
}

body {
  min-height: 100vh;
  display: block;
  align-items: unset;
  justify-content: unset;
  padding: 0 0 4rem;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 40%, rgba(99,102,241,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(139,92,246,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(59,130,246,0.08) 0%, transparent 50%);
  color: var(--text);
}


.status-help {
  position: relative;
  cursor: help;
}

.status-help::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  border: 6px solid transparent;
  border-bottom-color: rgba(18, 18, 30, 0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}

.status-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 20px);
  transform: translateX(-50%) translateY(-4px);
  width: max-content;
  max-width: 245px;
  white-space: pre-line;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(18, 18, 30, 0.98);
  color: #cbd5e1;
  box-shadow: 0 18px 46px rgba(0,0,0,0.52), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  font-size: 0.76rem;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  z-index: 400;
  transition: opacity 0.16s, transform 0.16s;
}

.status-help:hover::before,
.status-help:hover::after,
.status-help:focus::before,
.status-help:focus::after,
.status-help:focus-visible::before,
.status-help:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


.mode-toggle {
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.mode-toggle:hover { background: rgba(129, 140, 248, 0.2); color: #c7d2fe; }

.result-area {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1.1rem;
}

#passwords-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.5rem;
}
#passwords-list::-webkit-scrollbar { width: 4px; }
#passwords-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.password-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: #f8fafc;
  word-break: break-all;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.password-item:hover { background: rgba(129, 140, 248, 0.06); border-color: rgba(129, 140, 248, 0.15); }
.password-item span { min-width: 0; }

@keyframes copy-flash {
  0% { background: rgba(99, 102, 241, 0.35); }
  100% { background: rgba(255, 255, 255, 0.03); }
}
.password-item.flash { animation: copy-flash 0.5s ease-out; }

.copy-single-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.copy-single-btn:hover { color: #818cf8; background: rgba(129, 140, 248, 0.1); }

.copy-all-container {
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.icon-btn {
  background: transparent;
  border: none;
  color: #818cf8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.strength-meter { margin-bottom: 1.35rem; }
.strength-info { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.strength-meter-wrap { flex: 1; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.strength-bar { height: 100%; transition: width 0.3s; }
.entropy-display { font-size: 0.8rem; font-weight: 600; color: #94a3b8; white-space: nowrap; font-family: 'JetBrains Mono', monospace; }

.settings {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
}
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.setting-label { font-size: 0.95rem; color: #cbd5e1; }
.setting-hint { font-size: 0.75rem; color: #64748b; margin-left: 0.3rem; }

.input-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #818cf8;
  font-weight: 700;
  font-family: monospace;
  padding: 0.4rem 0.6rem;
  text-align: center;
  outline: none;
  font-size: 1.1rem;
}
.input-box:focus { border-color: #6366f1; background: rgba(255, 255, 255, 0.12); }

.number-stepper {
  display: inline-grid;
  grid-template-columns: minmax(54px, 1fr) 22px;
  align-items: stretch;
  min-height: 38px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.number-stepper:focus-within {
  border-color: rgba(129, 140, 248, 0.62);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.number-stepper .input-box {
  width: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.35rem 0.25rem 0.35rem 0.7rem;
  color: #a5b4fc;
  font-size: 1rem;
}

.number-stepper input[type="number"]::-webkit-outer-spin-button,
.number-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.number-stepper input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper-buttons {
  display: grid;
  grid-template-rows: 1fr 1fr;
  border-left: 1px solid rgba(129, 140, 248, 0.2);
}

.stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: rgba(255,255,255,0.035);
  color: #94a3b8;
  font-size: 0.58rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.stepper-btn:first-child { border-bottom: 1px solid rgba(129, 140, 248, 0.16); }
.stepper-btn:hover { background: rgba(129, 140, 248, 0.18); color: #e0e7ff; }
.stepper-btn:active { background: rgba(129, 140, 248, 0.28); }

.password-only { display: flex; }
.passphrase-only { display: none !important; }
.advanced-only { display: none !important; }
.is-advanced .advanced-only { display: flex !important; }
.is-passphrase .password-only { display: none !important; }
.is-passphrase .passphrase-only { display: flex !important; }
.is-passphrase .advanced-only.password-only { display: none !important; }

.mask-container { flex-direction: column; align-items: flex-start !important; gap: 0.5rem; }
.mask-input { width: 100%; text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 1rem; }
.checkbox-container { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: #6366f1; }

.generate-btn {
  margin-top: 1.25rem;
  width: 100%;
  padding: 1rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: all 0.2s;
}
.generate-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

.toast {
  position: fixed;
  right: 1.5rem;
  top: 6rem;
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.7rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
}
.toast.show { transform: translateY(0); opacity: 1; }

.input-small { width: 80px; }
.range-control { width: 100%; accent-color: #6366f1; }
.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
}
.custom-select-wordlen { width: 132px; }
.custom-select-separator { width: 162px; }

.custom-select-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(129, 140, 248, 0.32);
  background: rgba(99, 102, 241, 0.08);
  color: #a5b4fc;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
  background: rgba(99, 102, 241, 0.13);
  border-color: rgba(129, 140, 248, 0.58);
}
.custom-select-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.16);
}
.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-arrow {
  color: #94a3b8;
  font-size: 0.72rem;
  transition: transform 0.16s;
  flex-shrink: 0;
}
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }

.custom-select-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 300;
  width: 100%;
  min-width: 170px;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(18, 18, 30, 0.98);
  box-shadow: 0 18px 46px rgba(0,0,0,0.52), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  display: none;
}
.custom-select.open .custom-select-menu { display: grid; gap: 0.15rem; }

.custom-select-option {
  width: 100%;
  padding: 0.52rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: none;
  background: rgba(129, 140, 248, 0.16);
  color: #eef2ff;
}
.custom-select-option.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.88), rgba(139,92,246,0.8));
  color: #fff;
}

.password-item.no-options { color: #ef4444; cursor: default; }
.strength-bar { width: 0%; background-color: transparent; }
.strength-bar.strength-score-0 { width: 20%; background-color: #ef4444; }
.strength-bar.strength-score-1 { width: 40%; background-color: #f59e0b; }
.strength-bar.strength-score-2 { width: 60%; background-color: #eab308; }
.strength-bar.strength-score-3 { width: 80%; background-color: #22c55e; }
.strength-bar.strength-score-4 { width: 100%; background-color: #10b981; }

@media (max-width: 820px) {
  .mode-toggle { padding: 0.42rem 0.65rem; }
}

@media (max-width: 560px) {
  .password-item { font-size: 0.9rem; }
  .setting-item { align-items: flex-start; flex-direction: column; gap: 0.55rem; }
  .custom-select-wordlen, .custom-select-separator { width: min(100%, 170px); }
  .number-stepper { width: 104px; }
  .toast { left: 1rem; right: 1rem; top: auto; bottom: 1rem; text-align: center; }
}

/* Local visibility utility; avoids stale cached /css/common.css issues. */
.is-hidden { display: none !important; }
