.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 28px 28px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(var(--primary-rgb) / 0.16);
}

.title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input {
  width: 100%;
  min-height: var(--field-height);
  padding: var(--field-padding-y) var(--field-padding-x);
  font-size: var(--field-font-size);
  font-family: var(--font-ui);
  line-height: 1.4;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

.field input:disabled {
  opacity: 0.7;
}

.strength {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.strengthHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strengthTitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.strengthLabel {
  font-size: 11px;
  font-weight: 600;
}

.tone_empty { color: var(--text-muted); }
.tone_weak { color: #dc2626; }
.tone_fair { color: #d97706; }
.tone_good { color: #2563eb; }
.tone_strong { color: #16a34a; }

.strengthTrack {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  overflow: hidden;
}

.strengthFill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.22s ease, background-color 0.22s ease;
}

.fill_empty { background: transparent; }
.fill_weak { background: #ef4444; }
.fill_fair { background: #f59e0b; }
.fill_good { background: #3b82f6; }
.fill_strong { background: #22c55e; }

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.ruleMet {
  color: #15803d;
}

.ruleDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.55);
  flex-shrink: 0;
}

.ruleMet .ruleDot {
  background: #22c55e;
}

.error,
.success {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #15803d;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.cancelBtn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.cancelBtn:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.15);
}

.submitBtn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(var(--primary-rgb) / 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.submitBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--primary-rgb) / 0.38);
}

.submitBtn:disabled,
.cancelBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.closeBtn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.closeBtn:hover {
  background: rgba(var(--primary-rgb) / 0.08);
  color: var(--primary);
}

.overlayIn { animation: overlayFadeIn 0.22s ease forwards; }
.overlayOut { animation: overlayFadeOut 0.22s ease forwards; }
.modalIn { animation: modalFadeIn 0.25s ease forwards; }
.modalOut { animation: modalFadeOut 0.22s ease forwards; }

@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}
