/* ==========================================================================
   Password Generator — LastPass-like card
   Palette: brand red #D32D27 / page #F5F6F8 / card #FFFFFF
   ========================================================================== */

/* Base & layout
   -------------------------------------------------------------------------- */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F6F8;
  color: #1A1A1A;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Card
   -------------------------------------------------------------------------- */
#app.card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  padding: 40px;
  background: #FFFFFF;
  border-radius: 12px;
  border-top: 4px solid #D32D27;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.title {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 700;
  color: #1A1A1A;
}

/* Password row (field + icon buttons)
   -------------------------------------------------------------------------- */
.password-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

#password-output.password-field {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 100%;
  padding: 14px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 22px;
  letter-spacing: 1px;
}

.icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1A1A1A;
  cursor: pointer;
  transition: background-color .15s;
}

.icon-btn:hover {
  background: #F0F0F2;
}

.icon-btn:active {
  background: #E5E7EB;
}

/* Generate icon uses the brand accent */
#generate-btn {
  color: #D32D27;
}

/* Copy feedback toast (JS toggles .show)
   -------------------------------------------------------------------------- */
#copy-feedback.toast {
  position: absolute;
  top: -34px;
  right: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1A1A1A;
  color: #FFFFFF;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}

#copy-feedback.toast.show {
  opacity: 1;
  visibility: visible;
}

/* Strength bar
   -------------------------------------------------------------------------- */
#strength.strength-bar {
  height: 6px;
  margin: 16px 0 8px;
  border-radius: 3px;
  background: #E5E7EB;
  overflow: hidden;
}

#strength-fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: transparent;
  transition: width .2s, background-color .2s;
}

#strength-label {
  display: block;
  font-size: 13px;
  color: #6B7280;
}

/* Strength modifiers — JS toggles one on #strength.
   Drives the fill width/color and the label color. */
#strength.strength--weak   #strength-fill { width: 25%;  background: #E2231A; }
#strength.strength--fair   #strength-fill { width: 50%;  background: #F5A623; }
#strength.strength--good   #strength-fill { width: 75%;  background: #3DA45F; }
#strength.strength--strong #strength-fill { width: 100%; background: #1E8E3E; }

#strength.strength--weak   + #strength-label { color: #E2231A; }
#strength.strength--fair   + #strength-label { color: #F5A623; }
#strength.strength--good   + #strength-label { color: #3DA45F; }
#strength.strength--strong + #strength-label { color: #1E8E3E; }

/* Length control
   -------------------------------------------------------------------------- */
.length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
}

#length-value.length-value {
  font-weight: 700;
  color: #1A1A1A;
}

#length-slider.slider {
  width: 100%;
  margin: 12px 0 4px;
  accent-color: #D32D27;
  cursor: pointer;
}

/* Options (checkbox toggles)
   -------------------------------------------------------------------------- */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.toggle {
  accent-color: #D32D27;
  cursor: pointer;
}

/* Hint
   -------------------------------------------------------------------------- */
#hint.hint {
  margin-top: 12px;
  min-height: 16px;
  font-size: 13px;
  color: #6B7280;
}

/* Accessibility — visible focus for interactive controls
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid #D32D27;
  outline-offset: 2px;
}

/* Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 632px) {
  #app.card {
    width: calc(100% - 32px);
    margin: 0 16px;
    padding: 20px;
  }

  #password-output.password-field {
    font-size: 18px;
  }
}
