/* =====================================================
   BIZ-PASSWORD-INPUT — standalone reusable component
   Prefix: bpi-
   ===================================================== */

.bpi-root {
  width: 100%;
}

/* ── Two-column layout (matches epd-fields-row pattern) ── */
.bpi-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bpi-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Label ── */
.bpi-field-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7494;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Input wrap ── */
.bpi-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #f7f8fc;
  border: 1.5px solid #dde1ee;
  border-radius: 8px;
  transition: all 0.18s ease;
  overflow: hidden;
}

.bpi-input-wrap:focus-within {
  background: white;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.bpi-input-wrap.bpi-input-error {
  border-color: #e05252;
  background: #fff8f8;
}

.bpi-input-wrap.bpi-input-error:focus-within {
  box-shadow: 0 0 0 3px rgba(224, 82, 82, 0.12);
}

.bpi-input-wrap.bpi-input-valid {
  border-color: #3dba6e;
}

.bpi-input-icon {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  color: #b0b8d0 !important;
  margin-left: 12px;
  flex-shrink: 0;
  transition: color 0.18s;
}

.bpi-input-wrap:focus-within .bpi-input-icon {
  color: #667eea !important;
}

.bpi-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 11px 8px 11px 12px !important;
  font-size: 14px !important;
  color: #1e2535 !important;
  font-weight: 500;
  min-width: 0;
}

.bpi-input::placeholder {
  color: #b8bdd0 !important;
  font-weight: 400;
}

.bpi-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Reveal button ── */
.bpi-reveal-btn {
  width: 34px;
  height: 34px;
  margin-right: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.bpi-reveal-btn:hover:not(:disabled) {
  background: rgba(102, 126, 234, 0.08);
}

.bpi-reveal-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.bpi-reveal-btn md-icon {
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  color: #8890b0 !important;
}

.bpi-reveal-btn:hover:not(:disabled) md-icon {
  color: #667eea !important;
}

/* ── Strength meter ── */
.bpi-strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.bpi-strength-segments {
  display: flex;
  gap: 4px;
  flex: 1;
}

.bpi-strength-seg {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: #e8eaf0;
  transition: background 0.25s ease;
}

/* Color del segmento según el nivel en el contenedor padre */
.bpi-level-weak   .bpi-strength-seg.seg-fill { background: #e05252; }
.bpi-level-fair   .bpi-strength-seg.seg-fill { background: #f59e0b; }
.bpi-level-good   .bpi-strength-seg.seg-fill { background: #3b82f6; }
.bpi-level-strong .bpi-strength-seg.seg-fill { background: #16a34a; }

.bpi-strength-label {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bpi-strength-weak   { color: #e05252; }
.bpi-strength-fair   { color: #f59e0b; }
.bpi-strength-good   { color: #3b82f6; }
.bpi-strength-strong { color: #16a34a; }

/* ── Match indicator ── */
.bpi-match-indicator {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.bpi-match-ok {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #16a34a;
}

.bpi-match-fail {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e05252;
}

.bpi-match-ok md-icon,
.bpi-match-fail md-icon {
  font-size: 15px !important;
  width: 15px !important;
  height: 15px !important;
  color: inherit !important;
}

/* ── Field errors ── */
.bpi-field-errors {
  font-size: 12px;
  color: #e05252;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 2px;
}

.bpi-field-errors::before {
  content: '!';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e05252;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Policy hint ── */
.bpi-policy-hint {
  font-size: 11px;
  color: #9aa0b8;
  line-height: 1.4;
}

/* ── Auto-generate button ── */
.bpi-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 14px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(22, 163, 74, 0.12));
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  align-self: flex-start;
}

.bpi-generate-btn:hover {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.22), rgba(22, 163, 74, 0.18));
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.15);
}

.bpi-generate-btn md-icon {
  font-size: 15px !important;
  width: 15px !important;
  height: 15px !important;
  color: #16a34a !important;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .bpi-fields-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}